Index: libcxx/docs/UsingLibcxx.rst =================================================================== --- libcxx/docs/UsingLibcxx.rst +++ libcxx/docs/UsingLibcxx.rst @@ -242,11 +242,11 @@ purely as an extension. See :ref:`Extended Applications of [[nodiscard]] ` for more information. -**_LIBCPP_ENABLE_DEPRECATION_WARNINGS**: - This macro enables warnings when using deprecated components. For example, - when compiling in C++11 mode, using `std::auto_ptr` with the macro defined - will trigger a warning saying that `std::auto_ptr` is deprecated. By default, - this macro is not defined. +**_LIBCPP_DISABLE_DEPRECATION_WARNINGS**: + This macro disables warnings when using deprecated components. For example, + using `std::auto_ptr` when compiling in C++11 mode will normally trigger a + warning saying that `std::auto_ptr` is deprecated. If the macro is defined, + no warning will be emitted. By default, this macro is not defined. C++17 Specific Configuration Macros ----------------------------------- Index: libcxx/include/__config =================================================================== --- libcxx/include/__config +++ libcxx/include/__config @@ -1025,8 +1025,10 @@ #endif // Deprecation macros. -// Deprecations warnings are only enabled when _LIBCPP_ENABLE_DEPRECATION_WARNINGS is defined. -#if defined(_LIBCPP_ENABLE_DEPRECATION_WARNINGS) +// +// Deprecations warnings are always enabled, except when users explicitly opt-out +// by defining _LIBCPP_DISABLE_DEPRECATION_WARNINGS. +#if !defined(_LIBCPP_DISABLE_DEPRECATION_WARNINGS) # if __has_attribute(deprecated) # define _LIBCPP_DEPRECATED __attribute__ ((deprecated)) # elif _LIBCPP_STD_VER > 11 Index: libcxx/test/libcxx/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.cxx1z.pass.cpp =================================================================== --- libcxx/test/libcxx/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.cxx1z.pass.cpp +++ libcxx/test/libcxx/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.cxx1z.pass.cpp @@ -26,6 +26,7 @@ // MODULES_DEFINES: _LIBCPP_ENABLE_CXX17_REMOVED_RANDOM_SHUFFLE #define _LIBCPP_ENABLE_CXX17_REMOVED_RANDOM_SHUFFLE +#define _LIBCPP_DISABLE_DEPRECATION_WARNINGS #include #include Index: libcxx/test/libcxx/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.depr_in_cxx14.fail.cpp =================================================================== --- libcxx/test/libcxx/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.depr_in_cxx14.fail.cpp +++ libcxx/test/libcxx/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.depr_in_cxx14.fail.cpp @@ -21,9 +21,7 @@ // UNSUPPORTED: c++98, c++03, c++11 // REQUIRES: verify-support -// MODULES_DEFINES: _LIBCPP_ENABLE_DEPRECATION_WARNINGS // MODULES_DEFINES: _LIBCPP_ENABLE_CXX17_REMOVED_RANDOM_SHUFFLE -#define _LIBCPP_ENABLE_DEPRECATION_WARNINGS #define _LIBCPP_ENABLE_CXX17_REMOVED_RANDOM_SHUFFLE #include Index: libcxx/test/libcxx/depr/depr.auto.ptr/auto.ptr/auto_ptr.cxx1z.pass.cpp =================================================================== --- libcxx/test/libcxx/depr/depr.auto.ptr/auto.ptr/auto_ptr.cxx1z.pass.cpp +++ libcxx/test/libcxx/depr/depr.auto.ptr/auto.ptr/auto_ptr.cxx1z.pass.cpp @@ -16,8 +16,8 @@ // is defined before including , then auto_ptr will be restored. // MODULES_DEFINES: _LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR - #define _LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR +#define _LIBCPP_DISABLE_DEPRECATION_WARNINGS #include #include Index: libcxx/test/libcxx/depr/depr.auto.ptr/auto.ptr/auto_ptr.depr_in_cxx11.fail.cpp =================================================================== --- libcxx/test/libcxx/depr/depr.auto.ptr/auto.ptr/auto_ptr.depr_in_cxx11.fail.cpp +++ libcxx/test/libcxx/depr/depr.auto.ptr/auto.ptr/auto_ptr.depr_in_cxx11.fail.cpp @@ -22,9 +22,7 @@ // UNSUPPORTED: c++98, c++03 // REQUIRES: verify-support -// MODULES_DEFINES: _LIBCPP_ENABLE_DEPRECATION_WARNINGS // MODULES_DEFINES: _LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR -#define _LIBCPP_ENABLE_DEPRECATION_WARNINGS #define _LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR #include Index: libcxx/test/libcxx/depr/depr.function.objects/adaptors.depr_in_cxx11.fail.cpp =================================================================== --- libcxx/test/libcxx/depr/depr.function.objects/adaptors.depr_in_cxx11.fail.cpp +++ libcxx/test/libcxx/depr/depr.function.objects/adaptors.depr_in_cxx11.fail.cpp @@ -12,9 +12,7 @@ // UNSUPPORTED: c++98, c++03 // REQUIRES: verify-support -// MODULES_DEFINES: _LIBCPP_ENABLE_DEPRECATION_WARNINGS // MODULES_DEFINES: _LIBCPP_ENABLE_CXX17_REMOVED_BINDERS -#define _LIBCPP_ENABLE_DEPRECATION_WARNINGS #define _LIBCPP_ENABLE_CXX17_REMOVED_BINDERS #include Index: libcxx/test/libcxx/depr/depr.function.objects/depr.adaptors.cxx1z.pass.cpp =================================================================== --- libcxx/test/libcxx/depr/depr.function.objects/depr.adaptors.cxx1z.pass.cpp +++ libcxx/test/libcxx/depr/depr.function.objects/depr.adaptors.cxx1z.pass.cpp @@ -15,6 +15,7 @@ // MODULES_DEFINES: _LIBCPP_ENABLE_CXX17_REMOVED_BINDERS #define _LIBCPP_ENABLE_CXX17_REMOVED_BINDERS +#define _LIBCPP_DISABLE_DEPRECATION_WARNINGS #include #include Index: libcxx/test/std/depr/depr.lib.binders/depr.lib.bind.1st/bind1st.depr_in_cxx11.fail.cpp =================================================================== --- libcxx/test/std/depr/depr.lib.binders/depr.lib.bind.1st/bind1st.depr_in_cxx11.fail.cpp +++ libcxx/test/std/depr/depr.lib.binders/depr.lib.bind.1st/bind1st.depr_in_cxx11.fail.cpp @@ -14,9 +14,7 @@ // UNSUPPORTED: c++98, c++03 // REQUIRES: verify-support -// MODULES_DEFINES: _LIBCPP_ENABLE_DEPRECATION_WARNINGS // MODULES_DEFINES: _LIBCPP_ENABLE_CXX17_REMOVED_BINDERS -#define _LIBCPP_ENABLE_DEPRECATION_WARNINGS #define _LIBCPP_ENABLE_CXX17_REMOVED_BINDERS #include Index: libcxx/test/std/depr/depr.lib.binders/depr.lib.bind.2nd/bind2nd.depr_in_cxx11.fail.cpp =================================================================== --- libcxx/test/std/depr/depr.lib.binders/depr.lib.bind.2nd/bind2nd.depr_in_cxx11.fail.cpp +++ libcxx/test/std/depr/depr.lib.binders/depr.lib.bind.2nd/bind2nd.depr_in_cxx11.fail.cpp @@ -14,9 +14,7 @@ // UNSUPPORTED: c++98, c++03 // REQUIRES: verify-support -// MODULES_DEFINES: _LIBCPP_ENABLE_DEPRECATION_WARNINGS // MODULES_DEFINES: _LIBCPP_ENABLE_CXX17_REMOVED_BINDERS -#define _LIBCPP_ENABLE_DEPRECATION_WARNINGS #define _LIBCPP_ENABLE_CXX17_REMOVED_BINDERS #include Index: libcxx/test/std/depr/depr.lib.binders/depr.lib.binder.1st/binder1st.depr_in_cxx11.fail.cpp =================================================================== --- libcxx/test/std/depr/depr.lib.binders/depr.lib.binder.1st/binder1st.depr_in_cxx11.fail.cpp +++ libcxx/test/std/depr/depr.lib.binders/depr.lib.binder.1st/binder1st.depr_in_cxx11.fail.cpp @@ -14,9 +14,7 @@ // UNSUPPORTED: c++98, c++03 // REQUIRES: verify-support -// MODULES_DEFINES: _LIBCPP_ENABLE_DEPRECATION_WARNINGS // MODULES_DEFINES: _LIBCPP_ENABLE_CXX17_REMOVED_BINDERS -#define _LIBCPP_ENABLE_DEPRECATION_WARNINGS #define _LIBCPP_ENABLE_CXX17_REMOVED_BINDERS #include Index: libcxx/test/std/depr/depr.lib.binders/depr.lib.binder.2nd/binder2nd.depr_in_cxx11.fail.cpp =================================================================== --- libcxx/test/std/depr/depr.lib.binders/depr.lib.binder.2nd/binder2nd.depr_in_cxx11.fail.cpp +++ libcxx/test/std/depr/depr.lib.binders/depr.lib.binder.2nd/binder2nd.depr_in_cxx11.fail.cpp @@ -14,9 +14,7 @@ // UNSUPPORTED: c++98, c++03 // REQUIRES: verify-support -// MODULES_DEFINES: _LIBCPP_ENABLE_DEPRECATION_WARNINGS // MODULES_DEFINES: _LIBCPP_ENABLE_CXX17_REMOVED_BINDERS -#define _LIBCPP_ENABLE_DEPRECATION_WARNINGS #define _LIBCPP_ENABLE_CXX17_REMOVED_BINDERS #include Index: libcxx/test/std/utilities/function.objects/negators/binary_negate.depr_in_cxx17.fail.cpp =================================================================== --- libcxx/test/std/utilities/function.objects/negators/binary_negate.depr_in_cxx17.fail.cpp +++ libcxx/test/std/utilities/function.objects/negators/binary_negate.depr_in_cxx17.fail.cpp @@ -15,9 +15,6 @@ // UNSUPPORTED: c++98, c++03, c++11, c++14 // REQUIRES: verify-support -// MODULES_DEFINES: _LIBCPP_ENABLE_DEPRECATION_WARNINGS -#define _LIBCPP_ENABLE_DEPRECATION_WARNINGS - #include #include "test_macros.h" Index: libcxx/test/std/utilities/function.objects/negators/binary_negate.pass.cpp =================================================================== --- libcxx/test/std/utilities/function.objects/negators/binary_negate.pass.cpp +++ libcxx/test/std/utilities/function.objects/negators/binary_negate.pass.cpp @@ -10,6 +10,8 @@ // binary_negate +#define _LIBCPP_DISABLE_DEPRECATION_WARNINGS + #include #include #include Index: libcxx/test/std/utilities/function.objects/negators/not1.depr_in_cxx17.fail.cpp =================================================================== --- libcxx/test/std/utilities/function.objects/negators/not1.depr_in_cxx17.fail.cpp +++ libcxx/test/std/utilities/function.objects/negators/not1.depr_in_cxx17.fail.cpp @@ -15,9 +15,6 @@ // UNSUPPORTED: c++98, c++03, c++11, c++14 // REQUIRES: verify-support -// MODULES_DEFINES: _LIBCPP_ENABLE_DEPRECATION_WARNINGS -#define _LIBCPP_ENABLE_DEPRECATION_WARNINGS - #include #include "test_macros.h" Index: libcxx/test/std/utilities/function.objects/negators/not1.pass.cpp =================================================================== --- libcxx/test/std/utilities/function.objects/negators/not1.pass.cpp +++ libcxx/test/std/utilities/function.objects/negators/not1.pass.cpp @@ -10,6 +10,8 @@ // not1 +#define _LIBCPP_DISABLE_DEPRECATION_WARNINGS + #include #include Index: libcxx/test/std/utilities/function.objects/negators/not2.depr_in_cxx17.fail.cpp =================================================================== --- libcxx/test/std/utilities/function.objects/negators/not2.depr_in_cxx17.fail.cpp +++ libcxx/test/std/utilities/function.objects/negators/not2.depr_in_cxx17.fail.cpp @@ -15,9 +15,6 @@ // UNSUPPORTED: c++98, c++03, c++11, c++14 // REQUIRES: verify-support -// MODULES_DEFINES: _LIBCPP_ENABLE_DEPRECATION_WARNINGS -#define _LIBCPP_ENABLE_DEPRECATION_WARNINGS - #include #include "test_macros.h" Index: libcxx/test/std/utilities/function.objects/negators/not2.pass.cpp =================================================================== --- libcxx/test/std/utilities/function.objects/negators/not2.pass.cpp +++ libcxx/test/std/utilities/function.objects/negators/not2.pass.cpp @@ -10,6 +10,8 @@ // not2 +#define _LIBCPP_DISABLE_DEPRECATION_WARNINGS + #include #include Index: libcxx/test/std/utilities/function.objects/negators/unary_negate.depr_in_cxx17.fail.cpp =================================================================== --- libcxx/test/std/utilities/function.objects/negators/unary_negate.depr_in_cxx17.fail.cpp +++ libcxx/test/std/utilities/function.objects/negators/unary_negate.depr_in_cxx17.fail.cpp @@ -15,9 +15,6 @@ // UNSUPPORTED: c++98, c++03, c++11, c++14 // REQUIRES: verify-support -// MODULES_DEFINES: _LIBCPP_ENABLE_DEPRECATION_WARNINGS -#define _LIBCPP_ENABLE_DEPRECATION_WARNINGS - #include #include "test_macros.h" Index: libcxx/test/std/utilities/function.objects/negators/unary_negate.pass.cpp =================================================================== --- libcxx/test/std/utilities/function.objects/negators/unary_negate.pass.cpp +++ libcxx/test/std/utilities/function.objects/negators/unary_negate.pass.cpp @@ -10,6 +10,8 @@ // unary_negate +#define _LIBCPP_DISABLE_DEPRECATION_WARNINGS + #include #include #include