PR c++/65558
authormpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 25 Mar 2015 20:08:05 +0000 (20:08 +0000)
committermpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 25 Mar 2015 20:08:05 +0000 (20:08 +0000)
* name-lookup.c (handle_namespace_attrs): Ignore abi_tag attribute
on an anonymous namespace.

* g++.dg/cpp0x/pr65558.C: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@221672 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 65e1912..4ba45d7 100644 (file)
@@ -1,5 +1,11 @@
 2015-03-25  Marek Polacek  <polacek@redhat.com>
 
+       PR c++/65558
+       * name-lookup.c (handle_namespace_attrs): Ignore abi_tag attribute
+       on an anonymous namespace.
+
+2015-03-25  Marek Polacek  <polacek@redhat.com>
+
        PR c++/61670
        * class.c (remove_zero_width_bit_fields): Check for null DECL_SIZE.
 
index b85fbc9..4303ed5 100644 (file)
@@ -3663,6 +3663,12 @@ handle_namespace_attrs (tree ns, tree attributes)
                       "namespace", name);
              continue;
            }
+         if (!DECL_NAME (ns))
+           {
+             warning (OPT_Wattributes, "ignoring %qD attribute on anonymous "
+                      "namespace", name);
+             continue;
+           }
          if (!args)
            {
              tree dn = DECL_NAME (ns);
index c8f9033..68534fc 100644 (file)
@@ -1,5 +1,10 @@
 2015-03-25  Marek Polacek  <polacek@redhat.com>
 
+       PR c++/65558
+       * g++.dg/cpp0x/pr65558.C: New test.
+
+2015-03-25  Marek Polacek  <polacek@redhat.com>
+
        PR c++/61670
        * g++.dg/template/pr61670.C: New test.
 
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr65558.C b/gcc/testsuite/g++.dg/cpp0x/pr65558.C
new file mode 100644 (file)
index 0000000..5437e50
--- /dev/null
@@ -0,0 +1,6 @@
+// PR c++/65558
+// { dg-do compile { target c++11 } }
+
+inline namespace __attribute__((__abi_tag__))
+{ // { dg-warning "ignoring .__abi_tag__. attribute on anonymous namespace" }
+}