re PR c++/69795 (g++ ICE on invalid code on x86_64-linux-gnu in "reject_gcc_builtin")

PR c++/69795
	* c-common.c (reject_gcc_builtin): Check for FUNCTION_DECL rather than
	any DECL.

	* g++.dg/parse/invalid1.C: New test.

From-SVN: r233855
This commit is contained in:
Marek Polacek 2016-03-01 15:30:42 +00:00 committed by Marek Polacek
parent db340c730f
commit 1be56bc542
4 changed files with 17 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2016-03-01 Marek Polacek <polacek@redhat.com>
PR c++/69795
* c-common.c (reject_gcc_builtin): Check for FUNCTION_DECL rather than
any DECL.
2016-02-22 Martin Sebor <msebor@redhat.com>
PR middle-end/69780

View File

@ -12638,7 +12638,7 @@ reject_gcc_builtin (const_tree expr, location_t loc /* = UNKNOWN_LOCATION */)
if (TREE_TYPE (expr)
&& TREE_CODE (TREE_TYPE (expr)) == FUNCTION_TYPE
&& DECL_P (expr)
&& TREE_CODE (expr) == FUNCTION_DECL
/* The intersection of DECL_BUILT_IN and DECL_IS_BUILTIN avoids
false positives for user-declared built-ins such as abs or
strlen, and for C++ operators new and delete.

View File

@ -1,3 +1,8 @@
2016-03-01 Marek Polacek <polacek@redhat.com>
PR c++/69795
* g++.dg/parse/invalid1.C: New test.
2016-03-01 Richard Biener <rguenther@suse.de>
PR middle-end/70022

View File

@ -0,0 +1,5 @@
// PR c++/69795
// { dg-do compile { target c++11 } }
// { dg-options "-w" }
int foo ( foo += *[ // { dg-error "" }