| View previous topic :: View next topic |
| Author |
Message |
Hubert Schmid Guest
|
Posted: Mon Nov 24, 2003 8:09 pm Post subject: Problem mit Namensraeumen und typedef |
|
|
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
|
Posted: Tue Nov 25, 2003 11:04 pm Post subject: Re: Problem mit Namensraeumen und typedef |
|
|
"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
|
Posted: Thu Nov 27, 2003 8:36 pm Post subject: Re: Problem mit Namensraeumen und typedef |
|
|
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 |
|
 |
|