Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug in the objective-c++ compiler?



Hi!

For the following simple C++ code (nothing else) and using Xcode 2.1 with gcc4:

namespace Toto {
    enum Protocol {eOther};
    Protocol getProtocol(void) {return eOther;}
}

Can anyone tell me why I'm getting the following error message with the objective-c++ compiler:

main.mm:3: error: 'Toto::Protocol' referred to as 'struct'
main.mm:2: error: 'Toto::Protocol' has a previous declaration here

It appears as if there is a predefined "struct Protocol" in objective- c, and that the objective-c++ compiler is confusing it with Toto::Protocol wich is an enum type.

If I replace the word "Protocol" by anything else, the error message disappears. Also, if I compile with gcc3.3 instead of gcc4, there is not problem.

Is "Protocol" a new reserved keyword in objective-c?

Many thanks in advance,
--
MP

_______________________________________________
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

This email sent to email@hidden


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.