]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/58600 ([c++11] ICE on wrong usage of alignas)
authorPaolo Carlini <paolo.carlini@oracle.com>
Fri, 11 Apr 2014 17:36:44 +0000 (17:36 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Fri, 11 Apr 2014 17:36:44 +0000 (17:36 +0000)
/cp
2014-04-11  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/58600
* name-lookup.c (parse_using_directive): Return early if the
attribs argument is error_mark_node; use get_attribute_name.

/testsuite
2014-04-11  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/58600
* g++.dg/cpp0x/gen-attrs-58.C: New.
* g++.dg/cpp0x/gen-attrs-59.C: Likewise.

From-SVN: r209310

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

index 77473fef3b00c70f73815e1a6f05673c60e84d8d..f722da300e62407b70c8de3d7d9cf9aa70d4fb4b 100644 (file)
@@ -1,3 +1,9 @@
+2014-04-11  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/58600
+       * name-lookup.c (parse_using_directive): Return early if the
+       attribs argument is error_mark_node; use get_attribute_name.
+
 2014-04-11  Jason Merrill  <jason@redhat.com>
 
        DR 1030
index 0137c3f4a337019c974b9484e4231e445652a24c..8ad0d06f283c2065f2c13062e10ed4d8cc691107 100644 (file)
@@ -4019,13 +4019,14 @@ do_using_directive (tree name_space)
 void
 parse_using_directive (tree name_space, tree attribs)
 {
-  tree a;
-
   do_using_directive (name_space);
 
-  for (a = attribs; a; a = TREE_CHAIN (a))
+  if (attribs == error_mark_node)
+    return;
+
+  for (tree a = attribs; a; a = TREE_CHAIN (a))
     {
-      tree name = TREE_PURPOSE (a);
+      tree name = get_attribute_name (a);
       if (is_attribute_p ("strong", name))
        {
          if (!toplevel_bindings_p ())
index 0675d469f94564df678976ba77d0e9c89207af2b..fdacc9ce3f4a68f067627d17559bb027b91abad5 100644 (file)
@@ -1,3 +1,9 @@
+2014-04-11  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/58600
+       * g++.dg/cpp0x/gen-attrs-58.C: New.
+       * g++.dg/cpp0x/gen-attrs-59.C: Likewise.
+
 2014-04-11  Steve Ellcey  <sellcey@mips.com>
            Jakub Jelinek  <jakub@redhat.com>
 
diff --git a/gcc/testsuite/g++.dg/cpp0x/gen-attrs-58.C b/gcc/testsuite/g++.dg/cpp0x/gen-attrs-58.C
new file mode 100644 (file)
index 0000000..f760f56
--- /dev/null
@@ -0,0 +1,5 @@
+// PR c++/58600
+// { dg-do compile { target c++11 } }
+
+namespace N { int i; }
+using namespace N alignas(int); // { dg-warning "ignored" }
diff --git a/gcc/testsuite/g++.dg/cpp0x/gen-attrs-59.C b/gcc/testsuite/g++.dg/cpp0x/gen-attrs-59.C
new file mode 100644 (file)
index 0000000..c7839fe
--- /dev/null
@@ -0,0 +1,5 @@
+// PR c++/58600
+// { dg-do compile { target c++11 } }
+
+namespace N {}
+using namespace N alignas(X); // { dg-error "declared" }