Define std::string and related typedefs outside __cxx11 namespace
commit6cfbd82f290f606f92d6b2cd4ac185e3fc6fdc24
authorredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 9 Oct 2018 13:06:46 +0000 (9 13:06 +0000)
committerredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 9 Oct 2018 13:06:46 +0000 (9 13:06 +0000)
treefe52c12f4745d6dc6e912bdf1181fc9c1d0aec2d
parenta23722adc40042256928b73668b24f355da3dddb
Define std::string and related typedefs outside __cxx11 namespace

The typedefs for common specializations of std::__cxx11::basic_string do
not need to be in the std::__cxx11 namespace. Those typedefs are never
used for linkage purposes so don't appear in mangled names, and so don't
need to be distinct from the equivalent typedefs for the COW
std::basic_string specializations. It is OK for the same typedef to
refer to different types in different translation units.

Defining them directly in namespace std improves diagnostics that use
those typedefs. For example:

error: could not convert '1' from 'int' to 'std::__cxx11::string' {aka 'std::__cxx11::basic_string<char>'}

will now be printed as:

error: could not convert '1' from 'int' to 'std::string' {aka 'std::__cxx11::basic_string<char>'}

The precise type is still shown, but the typedef is not obfuscated with
the inline namespace.

* include/bits/stringfwd.h (string, wstring, u16string, u32string):
Define typedefs outside of __cxx11 inline namespace.
* python/libstdcxx/v6/printers.py (register_type_printers): Also
register printers for typedefs in new location.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@264958 138bc75d-0d04-0410-961f-82ee72b054a4
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/stringfwd.h
libstdc++-v3/python/libstdcxx/v6/printers.py