From 3d4de231f7215b4b890ccf89135772bd8f3a97db Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Fri, 30 Jun 2017 17:08:53 -0400 Subject: [PATCH] PR c++/81257 - ICE with invalid ::template. PR c++/54769 - wrong lookup of dependent template-name. * parser.c (cp_parser_template_name): Revert part of last change. From-SVN: r249855 --- gcc/cp/ChangeLog | 6 ++++++ gcc/cp/parser.c | 5 ----- gcc/testsuite/g++.dg/parse/template-keyword1.C | 3 +++ 3 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 gcc/testsuite/g++.dg/parse/template-keyword1.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index ff57214535f..eeeaeec5363 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2017-06-30 Jason Merrill + + PR c++/81257 - ICE with invalid ::template. + PR c++/54769 - wrong lookup of dependent template-name. + * parser.c (cp_parser_template_name): Revert part of last change. + 2017-06-30 Nathan Sidwell * config-lang.in (gtfiles): Add cp/lex.c. diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index ea5a5103565..a9623ae0841 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -15911,11 +15911,6 @@ cp_parser_template_name (cp_parser* parser, /*ambiguous_decls=*/NULL, token->location); - /* If the lookup failed and we got the 'template' keyword, believe it. */ - if (decl == error_mark_node && template_keyword_p - && processing_template_decl) - return identifier; - decl = strip_using_decl (decl); /* If DECL is a template, then the name was a template-name. */ diff --git a/gcc/testsuite/g++.dg/parse/template-keyword1.C b/gcc/testsuite/g++.dg/parse/template-keyword1.C new file mode 100644 index 00000000000..0a1298e75f5 --- /dev/null +++ b/gcc/testsuite/g++.dg/parse/template-keyword1.C @@ -0,0 +1,3 @@ +// PR c++/81257 + +template < typename ::template A < int > >; // { dg-error "" } -- 2.30.2