diff options
author | Marek Polacek <polacek@redhat.com> | 2016-03-01 15:30:42 +0000 |
---|---|---|
committer | Marek Polacek <mpolacek@gcc.gnu.org> | 2016-03-01 15:30:42 +0000 |
commit | 1be56bc54224b8e74c7596d243e24659970876b9 (patch) | |
tree | 1c76056314d365f536ae94dce51104f77562c64d | |
parent | db340c730f74885d09b9578986d4290890627a18 (diff) | |
download | gcc-1be56bc54224b8e74c7596d243e24659970876b9.tar.gz |
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
-rw-r--r-- | gcc/c-family/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/c-family/c-common.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/parse/invalid1.C | 5 |
4 files changed, 17 insertions, 1 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 66d74f402ab..7a5e323cc4d 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -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 diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c index 71da6e9b472..22ea7dafe42 100644 --- a/gcc/c-family/c-common.c +++ b/gcc/c-family/c-common.c @@ -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. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 50991821f2b..27e134fa8a4 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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 diff --git a/gcc/testsuite/g++.dg/parse/invalid1.C b/gcc/testsuite/g++.dg/parse/invalid1.C new file mode 100644 index 00000000000..f72e277488d --- /dev/null +++ b/gcc/testsuite/g++.dg/parse/invalid1.C @@ -0,0 +1,5 @@ +// PR c++/69795 +// { dg-do compile { target c++11 } } +// { dg-options "-w" } + +int foo ( foo += *[ // { dg-error "" } |