abi_tag questions
Stephan Bergmann
sbergman@redhat.com
Wed Nov 4 13:15:00 GMT 2015
On 11/04/2015 12:50 PM, Jonathan Wakely wrote:
> On 4 November 2015 at 17:18, Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
>> On 4 November 2015 at 14:37, Stephan Bergmann <sbergman@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.
More information about the Gcc
mailing list