This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: abi_tag questions


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]