The following code compiles under gcc-3.3 and earlier versions, but not under
versions of gcc 4 up to and including gcc-4.0.3 (and possibly later).

class Foo
{
    public:
        // This should act as a forward declaration of class Bar
        friend class Bar;
        Foo( Bar *b ) { bar = b; }

    protected:
        Bar *   bar;
};

class Bar
{
    public:
        Bar( Foo *f ) { foo = f; }

    protected:
        Foo *   foo;
};


-- 
           Summary: regression: friend no longer declares classes
           Product: gcc
           Version: 4.0.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tony at perforce dot com
 GCC build triplet: i486-linux-gnu
  GCC host triplet: i486-linux-gnu
GCC target triplet: i486-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30248

Reply via email to