Since a mem-initializer needs to be able to initialize any base class,
lookup for which is type-only, we in turn need to make mem-initializer-id
qualified name lookup type-only too.
PR c++/122192
gcc/cp/ChangeLog:
* parser.cc (cp_parser_mem_initializer_id): Pass class_type
instead of typename_type to cp_parser_class_name in the
nested-name-specifier case.
gcc/testsuite/ChangeLog:
* g++.dg/template/dependent-base6.C: Verify mem-initializer-id
qualified name lookup is type-only too.
Reported-by: Vincent X
Reviewed-by: Jason Merrill <jason@redhat.com>
return cp_parser_class_name (parser,
/*typename_keyword_p=*/true,
/*template_keyword_p=*/template_p,
- typename_type,
+ class_type,
/*check_dependency_p=*/true,
/*class_head_p=*/false,
/*is_declaration=*/true);
struct S1 : A::B { }; // OK
-template<class T> struct S2 : T::B { }; // OK, used to fail
+template<class T> struct S2 : T::B { // OK, used to fail
+ S2() : T::B() { } // Also OK
+};
template struct S2<A>;