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" "" }