// ---- foo.cpp struct [[gnu::abi_tag ("tag1", "tag2")]] Tagged1_2 { struct [[gnu::abi_tag ("tag3")]] Tagged3 { [[gnu::abi_tag ("tag4")]] int Tagged4 () { return 42; } } } Tagged1_2 inst1; // ---- foo.d @gnuAbiTag("tag1", "tag2") struct Tagged1_2 { // Notice the repetition @gnuAbiTag("tag1", "tag2", "tag3") struct Tagged3 { @gnuAbiTag("tag1", "tag2", "tag3", "tag4") int Tagged4 (); } } extern __gshared Tagged1_2 inst1;
Use this attribute to declare an ABI tag on a C++ symbol.
ABI tag is an attribute introduced by the GNU C++ compiler. It modifies the mangled name of the symbol to incorporate the tag name, in order to distinguish from an earlier version with a different ABI.
This is a special compiler recognized attribute, it has a few requirements, which all will be enforced by the compiler:
This UDA is not transitive, and inner scope do not inherit outer scopes' ABI tag. See examples below for how to translate a C++ declaration to D. Also note that entries in this UDA will be automatically sorted alphabetically, hence gnuAbiTag("c", "b", "a") will appear as @gnuAbiTag("a", "b", "c").