C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problem mit Namensraeumen und typedef

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ (German)
View previous topic :: View next topic  
Author Message
Hubert Schmid
Guest





PostPosted: Mon Nov 24, 2003 8:09 pm    Post subject: Problem mit Namensraeumen und typedef Reply with quote



Hi,

ich habe noch ein merkwürdiges Problem mit Namensräumen. Ich tippe mal
auf einen gcc (3.3) Bug:

namespace { typedef int foo; }
typedef int foo;
int main() { foo bar; } // error

error: `foo' undeclared (first use this function)

Gruß, Hubert

--
de.comp.lang.iso-c++ - Moderation: mailto:voyager+mod (AT) bud (DOT) prima.de
FAQ: http://www.voyager.prima.de/cpp/ mailto:voyager+send-faq (AT) bud (DOT) prima.de
Back to top
Markus Schaaf
Guest





PostPosted: Tue Nov 25, 2003 11:04 pm    Post subject: Re: Problem mit Namensraeumen und typedef Reply with quote



"Hubert Schmid" <h.schmid-usenet (AT) gmx (DOT) de> schrieb:

Quote:
namespace { typedef int foo; }
typedef int foo;
int main() { foo bar; } // error

error: `foo' undeclared (first use this function)

Die richtige Meldung wäre sowas wie:

ambiguous: __anonymous__::foo or ::foo

--
de.comp.lang.iso-c++ - Moderation: mailto:voyager+mod (AT) bud (DOT) prima.de
FAQ: http://www.voyager.prima.de/cpp/ mailto:voyager+send-faq (AT) bud (DOT) prima.de

Back to top
Andreas Nicolai
Guest





PostPosted: Thu Nov 27, 2003 8:36 pm    Post subject: Re: Problem mit Namensraeumen und typedef Reply with quote



Hi!

BCB 5 sagt:

[C++ Fehler] namespace.cpp(5): E2015 Mehrdeutigkeit zwischen 'foo' und
'<unnamedNS>::foo'

-> Bug in GCC 3.3



Abhilfe, entweder nichts im unbenannten Namespace deklarieren, oder

namespace { typedef int foo; }
typedef int foo;

int main() {
::foo test; // geht
};


Tschö - Andreas

--
de.comp.lang.iso-c++ - Moderation: mailto:voyager+mod (AT) bud (DOT) prima.de
FAQ: http://www.voyager.prima.de/cpp/ mailto:voyager+send-faq (AT) bud (DOT) prima.de
Back to top
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ (German) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.