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 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.

> 2  "The argument can be a list of strings of arbitrary length."
>
> Does that mean the list can be empty?
>
>> void f() __attribute__((__abi_tag__()));
>
>
> fails with "error: wrong number of arguments specified for â__abi_tag__â
> attribute" while
>
>> inline namespace n __attribute__((__abi_tag__())) {}
>
>
> is accepted by recent trunk GCC (as well as older versions).

That seems like a bug.

> (I stumbled across the latter on Fedora 23, where libstdc++'s
> <https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=226022> "Fix abi_tag
> in special modes" is not yet fixed, so it contains such an empty abi_tag on
> an inline namespace, and Clang with patch <http://reviews.llvm.org/D12834>
> "add gcc abi_tag support" produces an error.)


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