diff --git a/libstdc++-v3/include/bits/c++config b/libstdc++-v3/include/bits/c++config index a6495809671..02d11afc1aa 100644 --- a/libstdc++-v3/include/bits/c++config +++ b/libstdc++-v3/include/bits/c++config @@ -318,7 +318,8 @@ namespace std #if _GLIBCXX_USE_CXX11_ABI namespace std { - inline namespace __cxx11 __attribute__((__abi_tag__ ("cxx11"))) { } + inline namespace __cxx11 + __attribute__((__abi_tag__ ("cxx11"), __diagnose_as__("std"))) { } } namespace __gnu_cxx { diff --git a/libstdc++-v3/include/bits/stringfwd.h b/libstdc++-v3/include/bits/stringfwd.h index bcfd350e505..3f653feae14 100644 --- a/libstdc++-v3/include/bits/stringfwd.h +++ b/libstdc++-v3/include/bits/stringfwd.h @@ -74,22 +74,22 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 _GLIBCXX_END_NAMESPACE_CXX11 /// A string of @c char - typedef basic_string string; + typedef basic_string string __attribute__((__diagnose_as__)); /// A string of @c wchar_t - typedef basic_string wstring; + typedef basic_string wstring __attribute__((__diagnose_as__)); #ifdef _GLIBCXX_USE_CHAR8_T /// A string of @c char8_t - typedef basic_string u8string; + typedef basic_string u8string __attribute__((__diagnose_as__)); #endif #if __cplusplus >= 201103L /// A string of @c char16_t - typedef basic_string u16string; + typedef basic_string u16string __attribute__((__diagnose_as__)); /// A string of @c char32_t - typedef basic_string u32string; + typedef basic_string u32string __attribute__((__diagnose_as__)); #endif /** @} */ diff --git a/libstdc++-v3/include/debug/string b/libstdc++-v3/include/debug/string index a8389528001..d6299e5552f 100644 --- a/libstdc++-v3/include/debug/string +++ b/libstdc++-v3/include/debug/string @@ -1296,21 +1296,21 @@ namespace __gnu_debug return __res; } - typedef basic_string string; + typedef basic_string string __attribute__((__diagnose_as__)); - typedef basic_string wstring; + typedef basic_string wstring __attribute__((__diagnose_as__)); #ifdef _GLIBCXX_USE_CHAR8_T /// A string of @c char8_t - typedef basic_string u8string; + typedef basic_string u8string __attribute__((__diagnose_as__)); #endif #if __cplusplus >= 201103L /// A string of @c char16_t - typedef basic_string u16string; + typedef basic_string u16string __attribute__((__diagnose_as__)); /// A string of @c char32_t - typedef basic_string u32string; + typedef basic_string u32string __attribute__((__diagnose_as__)); #endif template diff --git a/libstdc++-v3/include/experimental/string b/libstdc++-v3/include/experimental/string index 4d92a7e39cc..91a9dd8b164 100644 --- a/libstdc++-v3/include/experimental/string +++ b/libstdc++-v3/include/experimental/string @@ -73,13 +73,13 @@ inline namespace fundamentals_v2 // basic_string typedef names using polymorphic allocator in namespace // std::experimental::pmr - typedef basic_string string; + typedef basic_string string __attribute__((__diagnose_as__)); #ifdef _GLIBCXX_USE_CHAR8_T - typedef basic_string u8string; + typedef basic_string u8string __attribute__((__diagnose_as__)); #endif - typedef basic_string u16string; - typedef basic_string u32string; - typedef basic_string wstring; + typedef basic_string u16string __attribute__((__diagnose_as__)); + typedef basic_string u32string __attribute__((__diagnose_as__)); + typedef basic_string wstring __attribute__((__diagnose_as__)); } // namespace pmr #endif diff --git a/libstdc++-v3/include/std/string b/libstdc++-v3/include/std/string index af840e887d5..03a3c68050f 100644 --- a/libstdc++-v3/include/std/string +++ b/libstdc++-v3/include/std/string @@ -62,13 +62,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template> using basic_string = std::basic_string<_CharT, _Traits, polymorphic_allocator<_CharT>>; - using string = basic_string; + using string [[__gnu__::__diagnose_as__]] = basic_string; #ifdef _GLIBCXX_USE_CHAR8_T - using u8string = basic_string; + using u8string [[__gnu__::__diagnose_as__]] = basic_string; #endif - using u16string = basic_string; - using u32string = basic_string; - using wstring = basic_string; + using u16string [[__gnu__::__diagnose_as__]] = basic_string; + using u32string [[__gnu__::__diagnose_as__]] = basic_string; + using wstring [[__gnu__::__diagnose_as__]] = basic_string; } // namespace pmr template