re PR c++/84092 (ICE on C++14 code with variable template: in build_qualified_name, at cp/tree.c:2043)

/cp
2018-01-31  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/84092
	* semantics.c (finish_qualified_id_expr): When handling an
	UNBOUND_CLASS_TEMPLATE only adjust qualifying_class and expr.

/testsuite
2018-01-31  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/84092
	* g++.dg/cpp1y/var-templ57.C: New.

From-SVN: r257242
This commit is contained in:
Paolo Carlini 2018-01-31 16:07:06 +00:00 committed by Paolo Carlini
parent 4ecd9c156c
commit be197ade2e
4 changed files with 21 additions and 6 deletions

View File

@ -1,3 +1,9 @@
2018-01-31 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/84092
* semantics.c (finish_qualified_id_expr): When handling an
UNBOUND_CLASS_TEMPLATE only adjust qualifying_class and expr.
2018-01-31 Marek Polacek <polacek@redhat.com>
PR c++/84138

View File

@ -2001,12 +2001,12 @@ finish_qualified_id_expr (tree qualifying_class,
if (template_p)
{
if (TREE_CODE (expr) == UNBOUND_CLASS_TEMPLATE)
/* cp_parser_lookup_name thought we were looking for a type,
but we're actually looking for a declaration. */
expr = build_qualified_name (/*type*/NULL_TREE,
TYPE_CONTEXT (expr),
TYPE_IDENTIFIER (expr),
/*template_p*/true);
{
/* cp_parser_lookup_name thought we were looking for a type,
but we're actually looking for a declaration. */
qualifying_class = TYPE_CONTEXT (expr);
expr = TYPE_IDENTIFIER (expr);
}
else
check_template_keyword (expr);
}

View File

@ -1,3 +1,8 @@
2018-01-31 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/84092
* g++.dg/cpp1y/var-templ57.C: New.
2018-01-31 Marek Polacek <polacek@redhat.com>
PR c++/84138

View File

@ -0,0 +1,4 @@
// PR c++/84092
// { dg-do compile { target c++14 } }
template < typename T > int a (T::template b);