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

2014-12-10 Thread Paolo Carlini
Hi, On 12/04/2014 07:17 PM, Kai Tietz wrote: So added testcase for this pr (its c++98 only) So: ChangeLog testsuite 2014-12-04 Kai Tietz kti...@redhat.com PR c++/64127 * g++.dg/cpp/pr64127.C: New file. Tested on x86_64-unknown-linux-gnu. Ok to apply prior posted patch plus

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

2014-12-04 Thread Kai Tietz
Hi, this patch fixes an ICE happening on invalid code for c++11. It is reasoned by accessing blindly identifier without checking that it is a declaration. ChangeLog 2014-12-04 Kai Tietz kti...@redhat.com PR c++/64127 * parser.c (cp_parser_diagnose_invalid_type_name): Check id

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

2014-12-04 Thread Marek Polacek
On Thu, Dec 04, 2014 at 04:12:02PM +0100, Kai Tietz wrote: Hi, this patch fixes an ICE happening on invalid code for c++11. It is reasoned by accessing blindly identifier without checking that it is a declaration. ChangeLog 2014-12-04 Kai Tietz kti...@redhat.com PR c++/64127

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

2014-12-04 Thread Kai Tietz
2014-12-04 16:47 GMT+01:00 Marek Polacek pola...@redhat.com: On Thu, Dec 04, 2014 at 04:12:02PM +0100, Kai Tietz wrote: Hi, this patch fixes an ICE happening on invalid code for c++11. It is reasoned by accessing blindly identifier without checking that it is a declaration. ChangeLog

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

2014-12-04 Thread Jakub Jelinek
On Thu, Dec 04, 2014 at 04:59:21PM +0100, Kai Tietz wrote: Same as said before. Issue is a invalid-code bug with ICE, and error-messages are pretty meaningless. It would be helpful to have in testsuite just the opportunity to test for no ICE. You can add just // { dg-error } on all lines

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

2014-12-04 Thread Kai Tietz
So added testcase for this pr (its c++98 only) So: ChangeLog testsuite 2014-12-04 Kai Tietz kti...@redhat.com PR c++/64127 * g++.dg/cpp/pr64127.C: New file. Tested on x86_64-unknown-linux-gnu. Ok to apply prior posted patch plus this new testcase? Regards, Kai Index:

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

2014-12-04 Thread Jason Merrill
On 12/04/2014 10:12 AM, Kai Tietz wrote: else if (cxx_dialect cxx11 +DECL_P (id) !strcmp (IDENTIFIER_POINTER (id), thread_local)) This doesn't make any sense: If it's a decl it isn't an identifier. Did you mean to check for IDENTIFIER_NODE? Jason

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

2014-12-04 Thread Kai Tietz
2014-12-04 20:35 GMT+01:00 Jason Merrill ja...@redhat.com: On 12/04/2014 10:12 AM, Kai Tietz wrote: else if (cxx_dialect cxx11 +DECL_P (id) !strcmp (IDENTIFIER_POINTER (id), thread_local)) This doesn't make any sense: If it's a decl it isn't an

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

2014-12-04 Thread Kai Tietz
Updated version checking the right thing ... ChangeLog gcc/cp 2014-12-04 Kai Tietz kti...@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

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

2014-12-04 Thread Jason Merrill
OK, thanks. Jason