This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/27787] Qualified lookup fails to find inherited class template



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]