re PR c++/64127 (ICE on invalid: tree check: expected identifier_node, have template_...
authorKai Tietz <ktietz@redhat.com>
Wed, 10 Dec 2014 11:29:22 +0000 (12:29 +0100)
committerKai Tietz <ktietz@gcc.gnu.org>
Wed, 10 Dec 2014 11:29:22 +0000 (12:29 +0100)
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
gcc/cp/parser.c

index a3d8d995853b92932f0c39877ff7fbc9d050c49c..c8a66b0de169233760411658ada908a5cdee09d9 100644 (file)
@@ -1,5 +1,9 @@
 2014-12-10  Kai Tietz  <ktietz@redhat.com>
 
+       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.
 
index 7bd9477a4e48234209b6f2f6afa825439b8e6714..48dd64a4c1703e5d62cec0e7ff21f2e1e1380943 100644 (file)
@@ -2977,6 +2977,7 @@ cp_parser_diagnose_invalid_type_name (cp_parser *parser, tree id,
        inform (location, "C++11 %<noexcept%> 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 %<thread_local%> only available with "
                "-std=c++11 or -std=gnu++11");