| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
On May 15, 2006, at 5:57 PM, Duane Murphy wrote:
--- 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?
So I went to the committee on this one. Here's the reply:
friend class ::xxx;
an extension for now.
friend xxx;
http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#138
-Howard
_______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/xcode-users/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>) | |
| >Re: Compile error in GCC but not other compilers (From: "Duane Murphy" <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.