sec.u (flags);
write_location (sec, DECL_SOURCE_LOCATION (ns));
+
+ if (DECL_NAMESPACE_INLINE_P (ns))
+ {
+ if (tree attr = lookup_attribute ("abi_tag", DECL_ATTRIBUTES (ns)))
+ {
+ tree tags = TREE_VALUE (attr);
+ sec.u (list_length (tags));
+ for (tree tag = tags; tag; tag = TREE_CHAIN (tag))
+ sec.str (TREE_STRING_POINTER (TREE_VALUE (tag)));
+ }
+ else
+ sec.u (0);
+ }
}
sec.end (to, to->name (MOD_SNAME_PFX ".nms"), crc_p);
/* See comment in write_namespace about why not bits. */
unsigned flags = sec.u ();
location_t src_loc = read_location (sec);
+ unsigned tags_count = (flags & 2) ? sec.u () : 0;
if (entity_index >= entity_num
|| !parent
|| (flags & 0xc) == 0x8)
sec.set_overrun ();
+
+ tree tags = NULL_TREE;
+ while (tags_count--)
+ {
+ size_t len;
+ const char *str = sec.str (&len);
+ tags = tree_cons (NULL_TREE, build_string (len + 1, str), tags);
+ tags = nreverse (tags);
+ }
+
if (sec.get_overrun ())
break;
DECL_MODULE_EXPORT_P (inner) = true;
}
+ if (tags)
+ DECL_ATTRIBUTES (inner)
+ = tree_cons (get_identifier ("abi_tag"), tags, DECL_ATTRIBUTES (inner));
+
/* Install the namespace. */
(*entity_ary)[entity_lwm + entity_index] = inner;
if (DECL_MODULE_IMPORT_P (inner))
--- /dev/null
+// PR c++/110730
+// { dg-additional-options -fmodule-header }
+// { dg-module-cmi {} }
+
+namespace std::filesystem {
+ inline namespace __cxx11 __attribute__((__abi_tag__("cxx11", "foo"))) {
+ struct path { };
+ }
+ inline path current_path() { return {}; };
+}