aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2017-06-30 17:08:53 -0400
committerJason Merrill <jason@gcc.gnu.org>2017-06-30 17:08:53 -0400
commit3d4de231f7215b4b890ccf89135772bd8f3a97db (patch)
tree16eca9598c66759dedf87f9c80adaf65d7e24c42 /gcc
parentfb6a764dfdb74bbd0acfb7dc8d95a98286637d8a (diff)
downloadgcc-3d4de231f7215b4b890ccf89135772bd8f3a97db.zip
gcc-3d4de231f7215b4b890ccf89135772bd8f3a97db.tar.gz
gcc-3d4de231f7215b4b890ccf89135772bd8f3a97db.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/parser.c5
-rw-r--r--gcc/testsuite/g++.dg/parse/template-keyword1.C3
3 files changed, 9 insertions, 5 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index ff57214..eeeaeec 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2017-06-30 Jason Merrill <jason@redhat.com>
+
+ 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 <nathan@acm.org>
* config-lang.in (gtfiles): Add cp/lex.c.
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index ea5a510..a9623ae 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 0000000..0a1298e
--- /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 "" }