From: Jakub Jelinek Date: Tue, 3 Apr 2018 16:21:02 +0000 (+0200) Subject: re PR c++/85140 (ICE with invalid use of alignas) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=93e544c1024f6afd47deae2fc6042bb2dfefafee;p=gcc.git re PR c++/85140 (ICE with invalid use of alignas) PR c++/85140 * name-lookup.c (handle_namespace_attrs): Return early if attributes is error_mark_node. * g++.dg/cpp0x/gen-attrs-64.C: New test. From-SVN: r259039 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 6404a74c363..d9406bfe962 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,9 @@ 2018-04-03 Jakub Jelinek + PR c++/85140 + * name-lookup.c (handle_namespace_attrs): Return early if attributes + is error_mark_node. + PR c++/85134 * decl.c (cp_finish_decl): If ensure_literal_type_for_constexpr_object fails, after clearing DECL_DECLARED_CONSTEXPR_P don't return early, diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index 061729a989b..9b5db3dc3aa 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -5044,6 +5044,9 @@ handle_namespace_attrs (tree ns, tree attributes) tree d; bool saw_vis = false; + if (attributes == error_mark_node) + return false; + for (d = attributes; d; d = TREE_CHAIN (d)) { tree name = get_attribute_name (d); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index bcc0714d107..e2a7cf276cb 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2018-04-03 Jakub Jelinek + PR c++/85140 + * g++.dg/cpp0x/gen-attrs-64.C: New test. + PR c++/85134 * g++.dg/gomp/pr85134.C: New test. * g++.dg/cpp0x/constexpr-ice19.C: Expect one further error. diff --git a/gcc/testsuite/g++.dg/cpp0x/gen-attrs-64.C b/gcc/testsuite/g++.dg/cpp0x/gen-attrs-64.C new file mode 100644 index 00000000000..c0d48fc88e9 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/gen-attrs-64.C @@ -0,0 +1,4 @@ +// PR c++/85140 +// { dg-do compile { target c++11 } } + +namespace N alignas() {} // { dg-error "expected" }