This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/27787] Qualified lookup fails to find inherited class template
- From: "tschwinger at neoscientists dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 28 May 2006 21:47:54 -0000
- Subject: [Bug c++/27787] Qualified lookup fails to find inherited class template
- References: <bug-27787-7865@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from tschwinger at neoscientists dot org 2006-05-28 21:47 -------
It seems my report is missing some detail.
Here's my apology and an attempt to outline my standard interpretation that
makes me think it is a bug.
(In reply to comment #0)
>
> template<typename X>
> struct x
> {
> template<typename Y>
> struct y
> {
> typedef Y type;
> };
> };
>
> template<typename A>
> struct a : x<A>
> {
> // template<typename B>
> // typename y<B>::type f(B); // ill-formed
- the base class 'x<A>' is obviously dependent (since it depends on 'A'), so
GCC validly detects an ill-formed program trying to find 'y' (and so does
Comeau)
> // qualified lookup should find inherited class template 'y', however
> template<typename B>
> typename a::template y<B>::type f(B);
- the injected class name 'a' refers to the class template specialization (same
as 'a<A>' in this context) and should be found even by unqualified lookup
(works correctly, so far)
- qualified lookup applies to 'template y' because it's qualified by 'a',
14.6.2-3 only applies to unqualified lookup so there is no reason for 'template
y' not to be found
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27787