CVS C++ can't parse nested class constructor

Chip Salzenberg chip@perlsupport.com
Sat Apr 17 18:01:00 GMT 1999


This very simple code used to compile with EGCS up until very
recently.  I wish I could be more precise, but I use CVS, not
snapshots.

-------------------------------------------------------------------
class Foo {
  public:
    class Bar;
};

class Foo::Bar {
  public:
    Bar() {}      // Error here
};
-------------------------------------------------------------------

What's really odd is that the error message mentions a semicolon on
the given, but there isn't one:

  $ g++ -v
  Reading specs from /usr/local/egcs/lib/gcc-lib/i586-pc-linux-gnu/egcs-2.93.18/specs
  gcc version egcs-2.93.18 19990417 (gcc2 ss-980929 experimental)
  $ g++ -c nested-ctor.cc
  nested-ctor.cc:8: parse error before `;'

-- 
Chip Salzenberg      - a.k.a. -      <chip@perlsupport.com>
      "When do you work?"   "Whenever I'm not busy."


More information about the Gcc-bugs mailing list