From e6f2df09a50cbc7e47260c616c0047aac472b342 Mon Sep 17 00:00:00 2001 From: Kai Tietz Date: Wed, 10 Dec 2014 12:29:22 +0100 Subject: re PR c++/64127 (ICE on invalid: tree check: expected identifier_node, have template_id_expr in cp_parser_diagnose_invalid_type_name, at cp/parser.c:2980) PR c++/64127 * parser.c (cp_parser_diagnose_invalid_type_name): Check id for being an identifier before accessing it. From-SVN: r218573 --- gcc/cp/ChangeLog | 4 ++++ gcc/cp/parser.c | 1 + 2 files changed, 5 insertions(+) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index a3d8d99..c8a66b0 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,9 @@ 2014-12-10 Kai Tietz + PR c++/64127 + * parser.c (cp_parser_diagnose_invalid_type_name): Check id + for being an identifier before accessing it. + PR c++/64100 * typeck.c (lookup_destructor): Handle incomplete type. diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 7bd9477..48dd64a 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -2977,6 +2977,7 @@ cp_parser_diagnose_invalid_type_name (cp_parser *parser, tree id, inform (location, "C++11 % only available with " "-std=c++11 or -std=gnu++11"); else if (cxx_dialect < cxx11 + && TREE_CODE (id) == IDENTIFIER_NODE && !strcmp (IDENTIFIER_POINTER (id), "thread_local")) inform (location, "C++11 % only available with " "-std=c++11 or -std=gnu++11"); -- cgit v1.1