tree name = get_attribute_name (d);
tree args = TREE_VALUE (d);
- if (is_attribute_p ("visibility", name))
+ if (is_attribute_p ("visibility", name)
+ && is_attribute_namespace_p ("gnu", d))
{
/* attribute visibility is a property of the syntactic block
rather than the namespace as a whole, so we don't touch the
push_visibility (TREE_STRING_POINTER (x), 1);
saw_vis = true;
}
- else if (is_attribute_p ("abi_tag", name))
+ else if (is_attribute_p ("abi_tag", name)
+ && is_attribute_namespace_p ("gnu", d))
{
if (!DECL_NAME (ns))
{
DECL_ATTRIBUTES (ns) = tree_cons (name, args,
DECL_ATTRIBUTES (ns));
}
- else if (is_attribute_p ("deprecated", name))
+ else if (is_attribute_p ("deprecated", name)
+ && is_attribute_namespace_p ("", d))
{
if (!DECL_NAME (ns))
{
--- /dev/null
+// PR c++/123684
+// { dg-do compile { target c++11 } }
+
+inline namespace [[foo::abi_tag (1, 2, 3)]] A {} // { dg-warning "'abi_tag' attribute directive ignored" }
+inline namespace [[foo::visibility (1, 2, 3)]] B {} // { dg-warning "'visibility' attribute directive ignored" }
+inline namespace [[foo::deprecated (1, 2, 3)]] C {} // { dg-warning "'deprecated' attribute directive ignored" }
+inline namespace [[abi_tag (1, 2, 3)]] D {} // { dg-warning "'abi_tag' attribute directive ignored" }
+inline namespace [[visibility (1, 2, 3)]] E {} // { dg-warning "'visibility' attribute directive ignored" }