This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the EGCS project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: gcc2.95 fails to compile correct code


> This source code compiles fine using gcc 2.91 but not with 2.95
[...]
>   friend class X;  // 2.95 fails to compile this line

Your code is in error. 7.1.5.3 Elaborated type specifiers,
[dcl.type.elab]/2 says, referring to

friend class­key identifier;

>> If the identifier resolves to a typedef-name or a template
>> type­parameter, the elaborated­type­specifier is ill­formed.

So your code is ill-formed; earlier versions of g++ failed to detect
the error.

Regards,
Martin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]