: parser->context->object_type);
if (scope && TYPE_P (scope)
&& (!CLASS_TYPE_P (scope)
- || (check_dependency_p && dependent_type_p (scope))))
+ || (check_dependency_p && dependent_scope_p (scope))))
{
/* We're optimizing away the call to cp_parser_lookup_name, but
we still need to do this. */
found = true;
}
- /* "in a type-only context" */
+ /* "that follows the keyword template"..."in a type-only context" */
if (!found && scope
- && tag_type != none_type
+ && (template_keyword_p || tag_type != none_type)
&& dependentish_scope_p (scope)
&& cp_parser_nth_token_starts_template_argument_list_p (parser, 1))
found = true;
cp_parser_error (parser, "expected template-name");
return error_mark_node;
}
- else if (decl == error_mark_node)
+ else if (!DECL_P (decl) && !is_overloaded_fn (decl))
/* Repeat the lookup at instantiation time. */
decl = identifier;
}
--- /dev/null
+// PR c++/102300
+
+template<typename T>
+struct holder
+{
+ template<typename F> struct fn {};
+
+ struct t1 : fn<T> {}; // pass
+ struct t2 : holder<T >::fn<T> {}; // fail
+ struct t3 : holder<T >::template fn<T> {}; // fail
+ struct t4 : holder<T*>::template fn<T> {}; // pass
+};