[Bug c++/15144] New: Template instantiation can't find symbol in global namespace
Gabriel Dos Reis
gdr@integrable-solutions.net
Tue Apr 27 03:32:00 GMT 2004
"stefan dot rupp at inform-ac dot com" <gcc-bugzilla@gcc.gnu.org> writes:
| In the following code
|
| template< class T >
| inline void foobar( const T& x ) {
| ::baz(x);
| }
|
| struct Data {};
| void baz( const Data& data ) {}
|
| int main() {
| Data d;
| foobar( d );
| }
|
| gcc 3.4 can't resolve the symbol ::baz correctly. It works, however, if I drop
| the qualification ::.
GCC-3.4.0 is right; previous versions were wrong.
"baz" as used in your code ought to be resolved at parsing time; since
there is no matching declaration at that time, it is an error.
See our FAQ.
-- Gaby
More information about the Gcc-bugs
mailing list