Skip to content

Commit 8b0031e

Browse files
philnik777aadeshps-mcw
authored andcommitted
[libc++] Disable header deprecations until llvm#168041 is landed (llvm#169305)
The `#warning` causes diagnostics if system headers include deprecated headers. llvm#168041 will add a way to deprecated headers properly, which then also interacts nicely with system header suppression.
1 parent 96724a4 commit 8b0031e

File tree

6 files changed

+29
-1
lines changed

6 files changed

+29
-1
lines changed

libcxx/include/__config

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,10 @@ typedef __char32_t char32_t;
546546
# define _LIBCPP_DEPRECATED_(m)
547547
# endif
548548

549-
# if defined(__DEPRECATED) && __DEPRECATED && !defined(_LIBCPP_DISABLE_DEPRECATION_WARNINGS)
549+
// FIXME: using `#warning` causes diagnostics from system headers which include deprecated headers. This can only be
550+
// enabled again once https://github.com/llvm/llvm-project/pull/168041 (or a similar feature) has landed, since that
551+
// allows suppression in system headers.
552+
# if defined(__DEPRECATED) && __DEPRECATED && !defined(_LIBCPP_DISABLE_DEPRECATION_WARNINGS) && 0
550553
# define _LIBCPP_DIAGNOSE_DEPRECATED_HEADERS 1
551554
# else
552555
# define _LIBCPP_DIAGNOSE_DEPRECATED_HEADERS 0

libcxx/test/std/depr/depr.cpp.headers/ccomplex.verify.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414
// UNSUPPORTED: c++03, c++11, c++14
1515
// UNSUPPORTED: clang-modules-build
1616

17+
// FIXME: using `#warning` causes diagnostics from system headers which include deprecated headers. This can only be
18+
// enabled again once https://github.com/llvm/llvm-project/pull/168041 (or a similar feature) has landed, since that
19+
// allows suppression in system headers.
20+
// XFAIL: *
21+
1722
#include <ccomplex>
1823

1924
// expected-warning@ccomplex:* {{<ccomplex> is deprecated in C++17 and removed in C++20. Include <complex> instead.}}

libcxx/test/std/depr/depr.cpp.headers/ciso646.verify.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414
// UNSUPPORTED: c++03, c++11, c++14, c++17
1515
// UNSUPPORTED: clang-modules-build
1616

17+
// FIXME: using `#warning` causes diagnostics from system headers which include deprecated headers. This can only be
18+
// enabled again once https://github.com/llvm/llvm-project/pull/168041 (or a similar feature) has landed, since that
19+
// allows suppression in system headers.
20+
// XFAIL: *
21+
1722
#include <ciso646>
1823

1924
// expected-warning@ciso646:* {{<ciso646> is removed in C++20. Include <version> instead.}}

libcxx/test/std/depr/depr.cpp.headers/cstdalign.verify.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414
// UNSUPPORTED: c++03, c++11, c++14
1515
// UNSUPPORTED: clang-modules-build
1616

17+
// FIXME: using `#warning` causes diagnostics from system headers which include deprecated headers. This can only be
18+
// enabled again once https://github.com/llvm/llvm-project/pull/168041 (or a similar feature) has landed, since that
19+
// allows suppression in system headers.
20+
// XFAIL: *
21+
1722
#include <cstdalign>
1823

1924
// expected-warning@cstdalign:* {{<cstdalign> is deprecated in C++17 and removed in C++20.}}

libcxx/test/std/depr/depr.cpp.headers/cstdbool.verify.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414
// UNSUPPORTED: c++03, c++11, c++14
1515
// UNSUPPORTED: clang-modules-build
1616

17+
// FIXME: using `#warning` causes diagnostics from system headers which include deprecated headers. This can only be
18+
// enabled again once https://github.com/llvm/llvm-project/pull/168041 (or a similar feature) has landed, since that
19+
// allows suppression in system headers.
20+
// XFAIL: *
21+
1722
#include <cstdbool>
1823

1924
// expected-warning@cstdbool:* {{<cstdbool> is deprecated in C++17 and removed in C++20.}}

libcxx/test/std/depr/depr.cpp.headers/ctgmath.verify.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414
// UNSUPPORTED: c++03, c++11, c++14
1515
// UNSUPPORTED: clang-modules-build
1616

17+
// FIXME: using `#warning` causes diagnostics from system headers which include deprecated headers. This can only be
18+
// enabled again once https://github.com/llvm/llvm-project/pull/168041 (or a similar feature) has landed, since that
19+
// allows suppression in system headers.
20+
// XFAIL: *
21+
1722
#include <ctgmath>
1823

1924
// expected-warning@ctgmath:* {{<ctgmath> is deprecated in C++17 and removed in C++20. Include <cmath> and <complex> instead.}}

0 commit comments

Comments
 (0)