On 04/04/2015 07:38 AM, Markus Trippelsdorf wrote:
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 declaration.
I don't know what clang will do with GCC 5's libstdc++, but if it doesn't support ABI tags then in the best case it will use the old ABI, and so undefined symbol errors are exactly what we want, rather than runtime corruption.
Another issue is that the -Wabi-tag warning isn't enabled by -Wall or even by -Wextra.
That's because I think the warning is mostly interesting for library vendors; most users shouldn't need to worry about it.
Jason