]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR c++/85140 (ICE with invalid use of alignas)
authorJakub Jelinek <jakub@redhat.com>
Mon, 25 Jun 2018 17:42:12 +0000 (19:42 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 25 Jun 2018 17:42:12 +0000 (19:42 +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: r262089

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 ccb09daa043e9699c2509473958be02bb42ad9ee..3078b4a05c5331975774495940ef941fff31d035 100644 (file)
@@ -1,6 +1,12 @@
 2018-06-25  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 a4a8af22db6592f8c797ea79603113c55e5aea25..5359eb4ea9542fbb6d5628feba0580d65152418b 100644 (file)
@@ -3633,6 +3633,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 b6083790bec0d461fa27dbfad251c5a9199a67fa..152e04c2234bbbd8b7f36cfa42b53845b49efcb9 100644 (file)
@@ -1,6 +1,11 @@
 2018-06-25  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" }