Commit 9ddfe5f4 by Jason Merrill Committed by Jason Merrill

PR c++/81204 - parse error with dependent template-name

	PR c++/81204 - parse error with dependent template-name
	* parser.c (cp_parser_lookup_name): Revert previous change.

From-SVN: r250037
parent d44b9748
2017-07-06 Jason Merrill <jason@redhat.com>
PR c++/81204 - parse error with dependent template-name
* parser.c (cp_parser_lookup_name): Revert previous change.
2017-07-06 David Malcolm <dmalcolm@redhat.com> 2017-07-06 David Malcolm <dmalcolm@redhat.com>
* cp-lang.c (LANG_HOOKS_RUN_LANG_SELFTESTS): Define as * cp-lang.c (LANG_HOOKS_RUN_LANG_SELFTESTS): Define as
......
...@@ -25855,22 +25855,11 @@ cp_parser_lookup_name (cp_parser *parser, tree name, ...@@ -25855,22 +25855,11 @@ cp_parser_lookup_name (cp_parser *parser, tree name,
decl = NULL_TREE; decl = NULL_TREE;
if (!decl) if (!decl)
{ /* Look it up in the enclosing context. DR 141: When looking for a
/* Look it up in the enclosing context. */ template-name after -> or ., only consider class templates. */
decl = lookup_name_real (name, prefer_type_arg (tag_type), decl = lookup_name_real (name, prefer_type_arg (tag_type, is_template),
/*nonclass=*/0, /*nonclass=*/0,
/*block_p=*/true, is_namespace, 0); /*block_p=*/true, is_namespace, 0);
/* DR 141 says when looking for a template-name after -> or ., only
consider class templates. */
if (decl && is_template && !DECL_TYPE_TEMPLATE_P (decl))
{
tree d = decl;
if (is_overloaded_fn (d))
d = get_first_fn (d);
if (DECL_P (d) && !DECL_CLASS_SCOPE_P (d))
decl = NULL_TREE;
}
}
if (object_type == unknown_type_node) if (object_type == unknown_type_node)
/* The object is type-dependent, so we can't look anything up; we used /* The object is type-dependent, so we can't look anything up; we used
this to get the DR 141 behavior. */ this to get the DR 141 behavior. */
// { dg-do compile { target c++11 } }
template <class A0, class... As> struct tuple
{
tuple<As...> tail;
template <int Offset, class... More> int apply(const More&... more) {
return tail.apply<1>(more...); // { dg-error "" } needs .template
}
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment