]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR c++/85140 (ICE with invalid use of alignas)
authorJakub Jelinek <jakub@redhat.com>
Fri, 22 Jun 2018 21:03:38 +0000 (23:03 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 22 Jun 2018 21:03:38 +0000 (23:03 +0200)
Backported from mainline
2018-04-03  Jakub Jelinek  <jakub@redhat.com>

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: r261944

gcc/cp/ChangeLog
gcc/cp/name-lookup.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/gen-attrs-64.C [new file with mode: 0644]

index 9eff156e8aab7514fb4b0b2a8474fd639180f5f1..b21322cb549490b3ad8d10ee4247d8b0e84ff4de 100644 (file)
@@ -1,6 +1,12 @@
 2018-06-22  Jakub Jelinek  <jakub@redhat.com>
 
        Backported from mainline
+       2018-04-03  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/85140
+       * name-lookup.c (handle_namespace_attrs): Return early if attributes
+       is error_mark_node.
+
        2018-03-30  Jakub Jelinek  <jakub@redhat.com>
 
        PR c++/84791
index dc8e82c2fe2c8012f40f62c4c3c2cb8fb42e29a8..6ccfdbfdb714481007187d9848d66ef710bb550a 100644 (file)
@@ -3684,6 +3684,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);
index e690c88bc1f5eda49d68586cd4e77c1f49e11ed3..e7fbda1082aeec4dc53caee0437c49e997507c62 100644 (file)
@@ -1,6 +1,11 @@
 2018-06-22  Jakub Jelinek  <jakub@redhat.com>
 
        Backported from mainline
+       2018-04-03  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/85140
+       * g++.dg/cpp0x/gen-attrs-64.C: New test.
+
        2018-03-30  Jakub Jelinek  <jakub@redhat.com>
 
        PR c++/84791
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 (file)
index 0000000..c0d48fc
--- /dev/null
@@ -0,0 +1,4 @@
+// PR c++/85140
+// { dg-do compile { target c++11 } }
+
+namespace N alignas() {}       // { dg-error "expected" }