• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Compile error in GCC but not other compilers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Compile error in GCC but not other compilers
      • From: Ronald Fenner <email@hidden>
    • Re: Compile error in GCC but not other compilers
      • From: Howard Hinnant <email@hidden>
References: 
 >Compile error in GCC but not other compilers (From: "James W. Walker" <email@hidden>)
 >Re: Compile error in GCC but not other compilers (From: Howard Hinnant <email@hidden>)

  • Prev by Date: Re: Compile error in GCC but not other compilers
  • Next by Date: Re: Compile error in GCC but not other compilers
  • Previous by thread: Re: Compile error in GCC but not other compilers
  • Next by thread: Re: Compile error in GCC but not other compilers
  • Index(es):
    • Date
    • Thread