This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/24161] [3.4/4.0/4.1 Regression] Lookup of template member function finds global type.
- From: "mark at codesourcery dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 Oct 2005 17:08:43 -0000
- Subject: [Bug c++/24161] [3.4/4.0/4.1 Regression] Lookup of template member function finds global type.
- References: <bug-24161-5876@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #7 from mark at codesourcery dot com 2005-10-03 17:08 -------
Subject: Re: [3.4/4.0/4.1 Regression] Lookup of template member
function finds global type.
redi at gcc dot gnu dot org wrote:
> ------- Comment #4 from redi at gcc dot gnu dot org 2005-10-03 16:54 -------
>
>>Until DR228 the name following ".template" had to be a member template, so the
>>code would have been invalid on those grounds.
>
>
> Erm, the name following .template *is* a member template, that's my whole
> point! :-)
:-)
The problem is that we can't do the lookup, because the expression
before the "." is dependent. But, we still have to do global-scope
lookup, because "t.template S<T>::f()" would be valid, if "S" were a
global template, and redundant "template" keywords are specifically allowed.
I do see your point, though. It's possible that the lookup after
"t.template" should be restricted so that if "t" is dependent, then no
lookup is performed.
> However, I'll take the question to a more appropriate forum and try to get an
> explanation there, rather than banging on about it here.
If you do get a DR opened about this, please let me know!
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24161