This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Why does -Wabi-tag complain when -std=c++03?
- From: Jeffrey Walton <noloader at gmail dot com>
- To: "gcc-help at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>
- Date: Thu, 24 Mar 2016 07:55:48 -0400
- Subject: Why does -Wabi-tag complain when -std=c++03?
- Authentication-results: sourceware.org; auth=none
- Reply-to: noloader at gmail dot com
I'm working on some test cases to try and understand "GCC5 and the
C++11 ABI", http://developerblog.redhat.com/2015/02/05/gcc5-and-the-c11-abi/.
In the test program below, why does -Wabi-tag trigger a warning with
the std::string when using -std=c++03?
Thanks in advance.
$ gcc --version
gcc (Ubuntu 5.2.1-22ubuntu2) 5.2.1 20151010
$ cat test.cxx
#include <string>
std::string foo __attribute__ ((visibility ("default")));
std::string bar __attribute__ ((visibility ("default")));
$ g++ -g3 -O2 -Wabi-tag -shared test.cxx -o test.so
test.cxx:3:13: warning: âfooâ inherits the "cxx11" ABI tag that
âstd::__cxx11::string {aka std::__cxx11::basic_string<char>}â (used in
its type) has [-Wabi-tag]
std::string foo __attribute__ ((visibility ("default")));
^
In file included from /usr/include/c++/5/string:52:0,
from test.cxx:1:
/usr/include/c++/5/bits/basic_string.h:71:11: note:
âstd::__cxx11::string {aka std::__cxx11::basic_string<char>}â declared
here
class basic_string
^
test.cxx:4:13: warning: âbarâ inherits the "cxx11" ABI tag that
âstd::__cxx11::string {aka std::__cxx11::basic_string<char>}â (used in
its type) has [-Wabi-tag]
std::string bar __attribute__ ((visibility ("default")));
^
In file included from /usr/include/c++/5/string:52:0,
from test.cxx:1:
/usr/include/c++/5/bits/basic_string.h:71:11: note:
âstd::__cxx11::string {aka std::__cxx11::basic_string<char>}â declared
here
class basic_string
^