Re: Compile error in GCC but not other compilers
Re: Compile error in GCC but not other compilers
- Subject: Re: Compile error in GCC but not other compilers
- From: "Duane Murphy" <email@hidden>
- Date: Mon, 15 May 2006 14:57:08 -0700
--- At Mon, 15 May 2006 17:15:55 -0400, Howard Hinnant wrote:
>On May 15, 2006, at 3:08 PM, James W. Walker wrote:
>
>> One of my problems in porting from CodeWarrior to Xcode boils down
>> to the code below:
>>
>> namespace
>> {
>> class xxx
>> {
>> xxx();
>> };
>> }
>>
>> class yyy
>> {
>> friend class xxx;
>> };
>>
>> xxx::xxx()
>> {
>> }
>>
>>
>> Xcode says:
>>
>> error: 'xxx' has not been declared
>> error: ISO C++ forbids declaration of 'xxx' with no type
>>
>> CodeWarrior has no problem with this code, nor does the Comeau
>> online compiler test page. So, is this a bug in GCC?
>
>This looks like a bug to me. You could pop "::" unto xxx in the
>friend statement to workaround:
>
>friend class ::xxx;
>
>Unfortunately it isn't a very good workaround because it is now
>illegal C++ code. :-(
I've hit this myself and scratched my head.
Can you explain why
friend class ::xxx;
is also illegal?
...Duane
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden