[Bug c++/13967] [3.3?/3.4/3.5 regression] template template argument identifier lookup fails scoping rules
gdr at integrable-solutions dot net
gcc-bugzilla@gcc.gnu.org
Mon Feb 2 02:18:00 GMT 2004
------- Additional Comments From gdr at integrable-solutions dot net 2004-02-02 02:18 -------
Subject: Re: [3.3?/3.4/3.5 regression] template template argument identifier lookup fails scoping rules
"gianni at mariani dot ws" <gcc-bugzilla@gcc.gnu.org> writes:
| ------- Additional Comments From gianni at mariani dot ws 2004-02-02 01:49 -------
| Gabriel Dos Reis writes:
| | ... and at line #1, the standard says that X::C should be found.
|
| I don't get what you're trying to say.
Exactly which part confuses you?
| Fact: If X::C does not exist then the function compiles correctly in
| gcc 3.4.
Yes, that is correct.
| So I'm confused as to what you mean "should be found". Can you cite
| the standard ?
What I meant is this:
struct X {
int C;
template<class> void func();
};
template<class C>
void X::func()
{
C c; // ERROR: C is not a type.
}
In the definition of X::func(), lookup for C will find X::C instead of
the template parameter. In the example you gave, X::C is a
non-template, so it will cause an error -- because the function gets
rewritten out of the class definition..
-- Gaby
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13967
More information about the Gcc-bugs
mailing list