This is the mail archive of the
mailing list for the GCC project.
Re: C++ PATCH for c++/65046 (ABI tags and functions/variables)
- From: Markus Trippelsdorf <markus at trippelsdorf dot de>
- To: Jason Merrill <jason at redhat dot com>
- Cc: gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 4 Apr 2015 13:38:48 +0200
- Subject: Re: C++ PATCH for c++/65046 (ABI tags and functions/variables)
- Authentication-results: sourceware.org; auth=none
- References: <550B20CD dot 3040708 at redhat dot com>
On 2015.03.19 at 15:17 -0400, Jason Merrill wrote:
> This patch makes some significant changes to attribute abi_tag.
> First, it allows explicit naming of tags on inline namespaces, which
> previously always had a tag with the same name as the namespace itself;
> this is still the default if no tag is specified.
> It also introduces automatic tagging of functions and variables with
> tagged types where the tags are not already reflected in the mangled
> name. I feel somewhat uneasy about this change, but I think it's the
> right answer. -Wabi-tag will also warn about this so that people are
> aware of it and can tag explicitly if they want to.
This breaks compatibility with other compilers. Consider the case when
a user compiles a library, that contains e.g. some member function with
a std::string return type, with clang using gcc-5's libstdc++. It will
be mangled without abi-tags, because clang doesn't support them.
Now when the user switches back to gcc-5 and uses the libraries headers
in a new project he will get undefined symbol errors when linking with
the library, because gcc-5 adds an abi-tag to the member function
Another issue is that the -Wabi-tag warning isn't enabled by -Wall or
even by -Wextra.