@@ -787,6 +787,23 @@ typedef __char32_t char32_t;
787
787
# define _LIBCPP_EXCLUDE_FROM_EXPLICIT_INSTANTIATION _LIBCPP_ALWAYS_INLINE
788
788
# endif
789
789
790
+ # ifdef _LIBCPP_COMPILER_CLANG_BASED
791
+ # define _LIBCPP_DIAGNOSTIC_PUSH _Pragma (" clang diagnostic push" )
792
+ # define _LIBCPP_DIAGNOSTIC_POP _Pragma (" clang diagnostic pop" )
793
+ # define _LIBCPP_CLANG_DIAGNOSTIC_IGNORED (str ) _Pragma (_LIBCPP_TOSTRING(clang diagnostic ignored str))
794
+ # define _LIBCPP_GCC_DIAGNOSTIC_IGNORED (str )
795
+ # elif defined(_LIBCPP_COMPILER_GCC)
796
+ # define _LIBCPP_DIAGNOSTIC_PUSH _Pragma (" GCC diagnostic push" )
797
+ # define _LIBCPP_DIAGNOSTIC_POP _Pragma (" GCC diagnostic pop" )
798
+ # define _LIBCPP_CLANG_DIAGNOSTIC_IGNORED (str )
799
+ # define _LIBCPP_GCC_DIAGNOSTIC_IGNORED (str ) _Pragma (_LIBCPP_TOSTRING(GCC diagnostic ignored str))
800
+ # else
801
+ # define _LIBCPP_DIAGNOSTIC_PUSH
802
+ # define _LIBCPP_DIAGNOSTIC_POP
803
+ # define _LIBCPP_CLANG_DIAGNOSTIC_IGNORED (str )
804
+ # define _LIBCPP_GCC_DIAGNOSTIC_IGNORED (str )
805
+ # endif
806
+
790
807
# if _LIBCPP_HARDENING_MODE == _LIBCPP_HARDENING_MODE_FAST
791
808
# define _LIBCPP_HARDENING_SIG f
792
809
# elif _LIBCPP_HARDENING_MODE == _LIBCPP_HARDENING_MODE_EXTENSIVE
@@ -881,14 +898,25 @@ typedef __char32_t char32_t;
881
898
882
899
// Inline namespaces are available in Clang/GCC/MSVC regardless of C++ dialect.
883
900
// clang-format off
884
- # define _LIBCPP_BEGIN_NAMESPACE_STD namespace _LIBCPP_TYPE_VISIBILITY_DEFAULT std { \
901
+ # define _LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_DIAGNOSTIC_PUSH \
902
+ _LIBCPP_CLANG_DIAGNOSTIC_IGNORED (" -Wc++11-extensions" ) \
903
+ _LIBCPP_CLANG_DIAGNOSTIC_IGNORED(" -Wc++14-extensions" ) \
904
+ _LIBCPP_CLANG_DIAGNOSTIC_IGNORED(" -Wc++17-extensions" ) \
905
+ _LIBCPP_CLANG_DIAGNOSTIC_IGNORED(" -Wc++20-extensions" ) \
906
+ _LIBCPP_CLANG_DIAGNOSTIC_IGNORED(" -Wc++23-extensions" ) \
907
+ _LIBCPP_CLANG_DIAGNOSTIC_IGNORED(" -Wc++26-extensions" ) \
908
+ _LIBCPP_GCC_DIAGNOSTIC_IGNORED(" -Wc++14-extensions" ) \
909
+ _LIBCPP_GCC_DIAGNOSTIC_IGNORED(" -Wc++17-extensions" ) \
910
+ _LIBCPP_GCC_DIAGNOSTIC_IGNORED(" -Wc++20-extensions" ) \
911
+ _LIBCPP_GCC_DIAGNOSTIC_IGNORED(" -Wc++23-extensions" ) \
912
+ namespace _LIBCPP_TYPE_VISIBILITY_DEFAULT std { \
885
913
inline namespace _LIBCPP_ABI_NAMESPACE {
886
- # define _LIBCPP_END_NAMESPACE_STD }}
914
+ # define _LIBCPP_END_NAMESPACE_STD }} _LIBCPP_DIAGNOSTIC_POP
887
915
888
916
# define _LIBCPP_BEGIN_NAMESPACE_FILESYSTEM _LIBCPP_BEGIN_NAMESPACE_STD \
889
917
inline namespace __fs { namespace filesystem {
890
918
891
- # define _LIBCPP_END_NAMESPACE_FILESYSTEM _LIBCPP_END_NAMESPACE_STD }}
919
+ # define _LIBCPP_END_NAMESPACE_FILESYSTEM }} _LIBCPP_END_NAMESPACE_STD
892
920
// clang-format on
893
921
894
922
# if __has_attribute(__enable_if__)
@@ -1322,23 +1350,6 @@ __sanitizer_verify_double_ended_contiguous_container(const void*, const void*, c
1322
1350
// the ABI inconsistent.
1323
1351
# endif
1324
1352
1325
- # ifdef _LIBCPP_COMPILER_CLANG_BASED
1326
- # define _LIBCPP_DIAGNOSTIC_PUSH _Pragma (" clang diagnostic push" )
1327
- # define _LIBCPP_DIAGNOSTIC_POP _Pragma (" clang diagnostic pop" )
1328
- # define _LIBCPP_CLANG_DIAGNOSTIC_IGNORED (str ) _Pragma (_LIBCPP_TOSTRING(clang diagnostic ignored str))
1329
- # define _LIBCPP_GCC_DIAGNOSTIC_IGNORED (str )
1330
- # elif defined(_LIBCPP_COMPILER_GCC)
1331
- # define _LIBCPP_DIAGNOSTIC_PUSH _Pragma (" GCC diagnostic push" )
1332
- # define _LIBCPP_DIAGNOSTIC_POP _Pragma (" GCC diagnostic pop" )
1333
- # define _LIBCPP_CLANG_DIAGNOSTIC_IGNORED (str )
1334
- # define _LIBCPP_GCC_DIAGNOSTIC_IGNORED (str ) _Pragma (_LIBCPP_TOSTRING(GCC diagnostic ignored str))
1335
- # else
1336
- # define _LIBCPP_DIAGNOSTIC_PUSH
1337
- # define _LIBCPP_DIAGNOSTIC_POP
1338
- # define _LIBCPP_CLANG_DIAGNOSTIC_IGNORED (str )
1339
- # define _LIBCPP_GCC_DIAGNOSTIC_IGNORED (str )
1340
- # endif
1341
-
1342
1353
// c8rtomb() and mbrtoc8() were added in C++20 and C23. Support for these
1343
1354
// functions is gradually being added to existing C libraries. The conditions
1344
1355
// below check for known C library versions and conditions under which these
0 commit comments