On 11/04/2015 12:50 PM, Jonathan Wakely wrote:
On 4 November 2015 at 17:18, Jonathan Wakely <jwakely....@gmail.com> wrote:
On 4 November 2015 at 14:37, Stephan Bergmann <sberg...@redhat.com> wrote:
I have two questions regarding the abi_tag attribute (as documented at
<https://gcc.gnu.org/onlinedocs/gcc/C_002b_002b-Attributes.html>):
1 "The attribute can also be applied to an inline namespace, but does not
affect the mangled name of the namespace; in this case it is only used for
-Wabi-tag warnings and automatic tagging of functions and variables."
I would naively assume that the "automatic tagging" part means that with
inline namespace n __attribute__((__abi_tag__("t"))) { void f() {} }
n::f would be tagged, but that appears not to be the case?
It's not tagged, because the tagged namespace "n" is already part of
the mangled name.
Oops, I meant to add that automatic tagging happens in cases like:
inline namespace n __attribute__((__abi_tag__("t"))) { struct X { }; }
X f();
Here ::f will be tagged, because its return type is a type defined in
a tagged namespace.
Thanks, got it.