This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: definitions with qualified names
- To: nathan at compsci dot bristol dot ac dot uk
- Subject: Re: definitions with qualified names
- From: "Martin v. Loewis" <martin at mira dot isdn dot cs dot tu-berlin dot de>
- Date: Mon, 26 Apr 1999 23:29:16 +0200
- CC: egcs-bugs at egcs dot cygnus dot com
- References: <372485BB.D9580FF6@acm.org>
> struct A
> {
> struct A::B { ...whatever ... };
> };
This is ill-formed. 9.3/2 says
>> A member function definition that appears outside of the class
>> definition shall appear in a namespace scope enclosing the class
>> definition.
> namespace NMS
> {
> int NMS::fn(); // missing pedwarn?
> struct NMS::A { // ICE
> };
> };
>
> Any cluons going spare?
For the second one, egcs-2.93.19 gives me (without options)
a.cc:4: `NMS' does not have a nested type named `A'
a.cc:5: anonymous class type not used to declare any objects
For the first one, we do need to produce diagnostics. Please note that
it already considers the following ill-formed:
namespace A{
void fn();
}
namespace NMS
{
int A::fn();
}
It says:
a.cc:6: declaration of `fn()' not in a namespace surrounding `A'
Regards,
Martin