Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!bellcore!faline!scherzo!allegra!alice!bs From: bs@alice.UUCP Newsgroups: comp.lang.c++ Subject: Scope of class name bug fix for 1.1 Message-ID: <6607@alice.uUCp> Date: Mon, 2-Feb-87 10:04:00 EST Article-I.D.: alice.6607 Posted: Mon Feb 2 10:04:00 1987 Date-Received: Tue, 3-Feb-87 04:19:14 EST Organization: AT&T Bell Laboratories, Murray Hill NJ Lines: 45 I had the following bug report mailed to me. Since I don't seem to be able to get the reply directly back and since the problem and its solution might be of more general interest I'll post it: Is this a bug? Or is the error message right: I cannot declare forward references for local classes in this release? I can define a class local to a class, but I cannot declare a class local to a class as forward. How do I get the following to work? I don't want bar to be visible, but I want pointers to bar before I declare bar. Thanks. class foo { class bar; class needs_bar { public: bar *k; }; class bar { public: needs_bar i; }; bar j; public: }; foo foo_bar; main() { } output from 1.1: "test.c", line 16: sorry, not implemented: local class bar and global class bar It ought to work. I get a syntax error for the forward declaration ``class bar;'' inside class foo. When I put ``class bar;'' outside it does work. To get the (modified) example to work on a release 1.1 simply grep for that error message (you'll find in norm.c or norm2.c) and remove it. Sorry.