From c05400428c1a95557ab0164ffb8d4952aa4dcdef Mon Sep 17 00:00:00 2001 From: Wesley Maxey Date: Fri, 18 Feb 2022 13:08:03 -0800 Subject: [PATCH 1/2] Add deprecation warnings used in upstream --- include/cuda/std/detail/libcxx/include/__config | 13 +++++++++++++ include/cuda/std/detail/libcxx/include/type_traits | 4 ++++ 2 files changed, 17 insertions(+) diff --git a/include/cuda/std/detail/libcxx/include/__config b/include/cuda/std/detail/libcxx/include/__config index 9a86c72f3f..2714477eca 100644 --- a/include/cuda/std/detail/libcxx/include/__config +++ b/include/cuda/std/detail/libcxx/include/__config @@ -1447,6 +1447,19 @@ typedef unsigned int char32_t; # define _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 #endif +// Macros to enter and leave a state where deprecation warnings are suppressed. +#if defined(_LIBCUDACXX_COMPILER_CLANG) || defined(_LIBCUDACXX_COMPILER_GCC) +# define _LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH \ + _Pragma("GCC diagnostic push") \ + _Pragma("GCC diagnostic ignored \"-Wdeprecated\"") \ + _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") +# define _LIBCUDACXX_SUPPRESS_DEPRECATED_POP \ + _Pragma("GCC diagnostic pop") +#else +# define _LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH +# define _LIBCUDACXX_SUPPRESS_DEPRECATED_POP +#endif + // The _LIBCUDACXX_NODISCARD_ATTRIBUTE should only be used to define other // NODISCARD macros to the correct attribute. #if __has_cpp_attribute(nodiscard) || (defined(_LIBCUDACXX_COMPILER_MSVC) && _LIBCUDACXX_STD_VER > 14) diff --git a/include/cuda/std/detail/libcxx/include/type_traits b/include/cuda/std/detail/libcxx/include/type_traits index f2ad40994f..9d1e6f9916 100644 --- a/include/cuda/std/detail/libcxx/include/type_traits +++ b/include/cuda/std/detail/libcxx/include/type_traits @@ -1125,8 +1125,12 @@ template struct _LIBCUDACXX_TEMPLATE_VIS add_rvalue_reference template using add_rvalue_reference_t = typename add_rvalue_reference<_Tp>::type; #endif +// Suppress deprecation notice for volatile-qualified return type resulting +// from volatile-qualified types _Tp. +_LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH template _LIBCUDACXX_INLINE_VISIBILITY _Tp&& __declval(int); template _LIBCUDACXX_INLINE_VISIBILITY _Tp __declval(long); +_LIBCUDACXX_SUPPRESS_DEPRECATED_POP template _LIBCUDACXX_INLINE_VISIBILITY From bbb020fb3d8544d0dfe8c5ed59742e66742c3e37 Mon Sep 17 00:00:00 2001 From: Wesley Maxey Date: Fri, 18 Feb 2022 13:09:37 -0800 Subject: [PATCH 2/2] WAR some expected failured in tests, will need to update libcxx to ensure these tests pass --- .../func.search/func.search.bm/default.pass.cpp | 2 +- .../func.search/func.search.bm/hash.pass.cpp | 2 +- .../func.search.bm/hash.pred.pass.cpp | 2 +- .../func.search/func.search.bm/pred.pass.cpp | 2 +- .../func.search.bmh/default.pass.cpp | 2 +- .../func.search/func.search.bmh/hash.pass.cpp | 2 +- .../func.search.bmh/hash.pred.pass.cpp | 2 +- .../func.search/func.search.bmh/pred.pass.cpp | 2 +- .../meta/meta.rel/is_invocable.pass.cpp | 2 +- .../meta.trans.other/result_of11.pass.cpp | 17 ++++++++++++++++- 10 files changed, 25 insertions(+), 10 deletions(-) diff --git a/libcxx/test/std/utilities/function.objects/func.search/func.search.bm/default.pass.cpp b/libcxx/test/std/utilities/function.objects/func.search/func.search.bm/default.pass.cpp index e48a5f4ea0..6d00109503 100644 --- a/libcxx/test/std/utilities/function.objects/func.search/func.search.bm/default.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/func.search/func.search.bm/default.pass.cpp @@ -7,7 +7,7 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: c++98, c++03, c++11, c++14 -// XFAIL: c++17, c++2a +// XFAIL: c++17, c++2a, c++20 // diff --git a/libcxx/test/std/utilities/function.objects/func.search/func.search.bm/hash.pass.cpp b/libcxx/test/std/utilities/function.objects/func.search/func.search.bm/hash.pass.cpp index e9d93fc07f..d0aa1dc536 100644 --- a/libcxx/test/std/utilities/function.objects/func.search/func.search.bm/hash.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/func.search/func.search.bm/hash.pass.cpp @@ -7,7 +7,7 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: c++98, c++03, c++11, c++14 -// XFAIL: c++17, c++2a +// XFAIL: c++17, c++2a, c++20 // diff --git a/libcxx/test/std/utilities/function.objects/func.search/func.search.bm/hash.pred.pass.cpp b/libcxx/test/std/utilities/function.objects/func.search/func.search.bm/hash.pred.pass.cpp index 32f82df85f..7901a16d20 100644 --- a/libcxx/test/std/utilities/function.objects/func.search/func.search.bm/hash.pred.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/func.search/func.search.bm/hash.pred.pass.cpp @@ -7,7 +7,7 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: c++98, c++03, c++11, c++14 -// XFAIL: c++17, c++2a +// XFAIL: c++17, c++2a, c++20 // diff --git a/libcxx/test/std/utilities/function.objects/func.search/func.search.bm/pred.pass.cpp b/libcxx/test/std/utilities/function.objects/func.search/func.search.bm/pred.pass.cpp index 70e182eb4d..e4fc2eabf1 100644 --- a/libcxx/test/std/utilities/function.objects/func.search/func.search.bm/pred.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/func.search/func.search.bm/pred.pass.cpp @@ -7,7 +7,7 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: c++98, c++03, c++11, c++14 -// XFAIL: c++17, c++2a +// XFAIL: c++17, c++2a, c++20 // diff --git a/libcxx/test/std/utilities/function.objects/func.search/func.search.bmh/default.pass.cpp b/libcxx/test/std/utilities/function.objects/func.search/func.search.bmh/default.pass.cpp index 14c295f403..be24d6d342 100644 --- a/libcxx/test/std/utilities/function.objects/func.search/func.search.bmh/default.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/func.search/func.search.bmh/default.pass.cpp @@ -7,7 +7,7 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: c++98, c++03, c++11, c++14 -// XFAIL: c++17, c++2a +// XFAIL: c++17, c++2a, c++20 // diff --git a/libcxx/test/std/utilities/function.objects/func.search/func.search.bmh/hash.pass.cpp b/libcxx/test/std/utilities/function.objects/func.search/func.search.bmh/hash.pass.cpp index d364f3e00b..43904deda3 100644 --- a/libcxx/test/std/utilities/function.objects/func.search/func.search.bmh/hash.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/func.search/func.search.bmh/hash.pass.cpp @@ -7,7 +7,7 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: c++98, c++03, c++11, c++14 -// XFAIL: c++17, c++2a +// XFAIL: c++17, c++2a, c++20 // diff --git a/libcxx/test/std/utilities/function.objects/func.search/func.search.bmh/hash.pred.pass.cpp b/libcxx/test/std/utilities/function.objects/func.search/func.search.bmh/hash.pred.pass.cpp index ac9bdae6e1..040a680213 100644 --- a/libcxx/test/std/utilities/function.objects/func.search/func.search.bmh/hash.pred.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/func.search/func.search.bmh/hash.pred.pass.cpp @@ -7,7 +7,7 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: c++98, c++03, c++11, c++14 -// XFAIL: c++17, c++2a +// XFAIL: c++17, c++2a, c++20 // diff --git a/libcxx/test/std/utilities/function.objects/func.search/func.search.bmh/pred.pass.cpp b/libcxx/test/std/utilities/function.objects/func.search/func.search.bmh/pred.pass.cpp index 4494f7644c..9f63769236 100644 --- a/libcxx/test/std/utilities/function.objects/func.search/func.search.bmh/pred.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/func.search/func.search.bmh/pred.pass.cpp @@ -7,7 +7,7 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: c++98, c++03, c++11, c++14 -// XFAIL: c++17, c++2a +// XFAIL: c++17, c++2a, c++20 // diff --git a/libcxx/test/std/utilities/meta/meta.rel/is_invocable.pass.cpp b/libcxx/test/std/utilities/meta/meta.rel/is_invocable.pass.cpp index fa0c0c82e8..32db9d1209 100644 --- a/libcxx/test/std/utilities/meta/meta.rel/is_invocable.pass.cpp +++ b/libcxx/test/std/utilities/meta/meta.rel/is_invocable.pass.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++98, c++03, c++11, c++14 +// UNSUPPORTED: c++03, c++11, c++14 // type_traits diff --git a/libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/result_of11.pass.cpp b/libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/result_of11.pass.cpp index 2128590047..3dab01b7a3 100644 --- a/libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/result_of11.pass.cpp +++ b/libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/result_of11.pass.cpp @@ -6,17 +6,27 @@ // //===----------------------------------------------------------------------===// // -// UNSUPPORTED: c++98, c++03 +// UNSUPPORTED: c++03 // // // // result_of +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCUDACXX_ENABLE_CXX20_REMOVED_TYPE_TRAITS +// ADDITIONAL_COMPILE_FLAGS: -D_LIBCUDACXX_DISABLE_DEPRECATION_WARNINGS + #include +#include #include #include #include "test_macros.h" +// Ignore warnings about volatile in parameters being deprecated. +// We know it is, but we still have to test it. +#if defined(TEST_COMPILER_GCC) +# pragma GCC diagnostic ignored "-Wvolatile" +#endif + struct wat { wat& operator*() { return *this; } @@ -55,6 +65,9 @@ void test_result_of_imp() #endif } +// Do not warn on deprecated uses of 'volatile' below. +_LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH + int main(int, char**) { { @@ -171,3 +184,5 @@ int main(int, char**) return 0; } + +_LIBCUDACXX_SUPPRESS_DEPRECATED_POP \ No newline at end of file