From: Marek Polacek Date: Mon, 12 Dec 2016 17:58:00 +0000 (+0000) Subject: re PR c++/78647 (ICE on invalid C++ code on x86_64-linux-gnu (internal compiler error... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fe366b87159c5ac790045b3e578993d5be6bbdfb;p=gcc.git re PR c++/78647 (ICE on invalid C++ code on x86_64-linux-gnu (internal compiler error: tree check: expected tree_list, have error_mark in get_attribute_name, at attribs.c:664)) PR c++/78647 * c-common.c (attribute_fallthrough_p): Return false for error_mark_node. * g++.dg/parse/error58.C: New. From-SVN: r243575 --- diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index d6e1b8b15b0..547edadab3d 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,9 @@ +2016-12-12 Marek Polacek + + PR c++/78647 + * c-common.c (attribute_fallthrough_p): Return false for + error_mark_node. + 2016-12-08 Martin Sebor PR c/78284 diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c index 0749361fb44..c8e1f0da3c1 100644 --- a/gcc/c-family/c-common.c +++ b/gcc/c-family/c-common.c @@ -5558,6 +5558,8 @@ parse_optimize_options (tree args, bool attr_p) bool attribute_fallthrough_p (tree attr) { + if (attr == error_mark_node) + return false; tree t = lookup_attribute ("fallthrough", attr); if (t == NULL_TREE) return false; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f1f518411db..d6657b574d9 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-12-12 Marek Polacek + + PR c++/78647 + * g++.dg/parse/error58.C: New. + 2016-12-12 David Malcolm PR preprocessor/78680 diff --git a/gcc/testsuite/g++.dg/parse/error58.C b/gcc/testsuite/g++.dg/parse/error58.C new file mode 100644 index 00000000000..5ed6e1e19bd --- /dev/null +++ b/gcc/testsuite/g++.dg/parse/error58.C @@ -0,0 +1,7 @@ +// PR c++/78647 +// { dg-do compile { target c++11 } } +// { dg-options "-w" } + +struct A; +void foo (); +void f() { alignas (foo (A)); } // { dg-error "expected" "" }