[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gcc
Subject:    A possible bug(?)
From:       Carlo Wood <carlo () runaway ! xs4all ! nl>
Date:       1999-10-06 17:30:37
[Download RAW message or body]

Hi,

this is the last thing that I ran into after upgrading
from 2.91 to 2.95.1.  (While compiling my libcw - also
known as "the egcs template bug finder" ;).

I am not too good in understanding the standard, so I am
dropping it here - leaving it to others to decide if this
is a bug or not (probably not).

~/c++/tests>g++ -c bug2.95.1.cc
bug2.95.1.cc:3: invalid use of undefined type `class A'
bug2.95.1.cc:1: forward declaration of `class A'

~/c++/tests>cat bug2.95.1.cc
class A {
  class B {
    friend void A::foo(void);
    B(void) { }
  };
public:
  void foo(void);
};

void A::foo(void)
{
}

This compiled fine with egcs-1.1.2 (release).
Now I need to put the line "void foo(void);" above
the declaration of the enclosed class B.

The question is thus, what does the standard say about this?

Regards,

 Carlo Wood  <carlo@runaway.xs4all.nl>

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic