[cfe-dev] Error name lookup in template dependant base class

John McCall rjmccall at apple.com
Sat Dec 4 02:28:42 PST 2010


On Dec 4, 2010, at 2:12 AM, Adrien Chauve wrote:
> Thanks for the link, it's exactly what I was searching for.
> 
> But I'm not sure my example code (ant the example on the page you pointed at) is invalid. In case of a function call where at least one argument is a template dependant name, the call should not be qualified (cf "C++ Templates The Complete Guide" by D. Vandervoorde and N. M. Josuttis, section 9.4.2 pp 136-138).

The rule is that (1) if the lookup at definition time doesn't find a class member and (2) there's at least one type-dependent argument then (3) we can't resolve the call at definition time because we have to do argument-dependent lookup during instantiation.  ADL never find class members, though.

The bug in gcc is that it also performs unqualified lookup at instantiation time and therefore finds class members from previously-dependent base classes that it's really not supposed to find.

John.



More information about the cfe-dev mailing list