diff mbox

[c++] : Fix PR/64127 ICE on invalid: tree check: exprected identifier_node, have template_id_expr in cp_parser_diagnose_invalid_type_name

Message ID CAEwic4axb1tgPWQQEKyQq4q-h1k8nwMGchqeh-QLLf+4UBC_GQ@mail.gmail.com
State New
Headers show

Commit Message

Kai Tietz Dec. 4, 2014, 8:14 p.m. UTC
Updated version checking the right thing ...

ChangeLog gcc/cp

2014-12-04  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.

Tested on x86_64-unknown-linux-gnu.

Ok for apply together with testcase?

Regards,
Kai

Comments

Jason Merrill Dec. 4, 2014, 8:41 p.m. UTC | #1
OK, thanks.

Jason
diff mbox

Patch

Index: parser.c
===================================================================
--- parser.c    (Revision 218309)
+++ parser.c    (Arbeitskopie)
@@ -2977,6 +2977,7 @@  cp_parser_diagnose_invalid_type_name (cp_parser *p
     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");