File tree Expand file tree Collapse file tree 12 files changed +27
-78
lines changed Expand file tree Collapse file tree 12 files changed +27
-78
lines changed Original file line number Diff line number Diff line change @@ -721,6 +721,12 @@ typedef __char32_t char32_t;
721721# define _LIBCPP_DEPRECATED_ (m )
722722# endif
723723
724+ # if defined(__DEPRECATED) && __DEPRECATED && !defined(_LIBCPP_DISABLE_DEPRECATION_WARNINGS) && !__building_module(std)
725+ # define _LIBCPP_DIAGNOSE_DEPRECATED_HEADERS 1
726+ # else
727+ # define _LIBCPP_DIAGNOSE_DEPRECATED_HEADERS 0
728+ # endif
729+
724730# if !defined(_LIBCPP_CXX03_LANG)
725731# define _LIBCPP_DEPRECATED_IN_CXX11 _LIBCPP_DEPRECATED
726732# else
Original file line number Diff line number Diff line change 2626# pragma GCC system_header
2727# endif
2828
29- # if _LIBCPP_STD_VER >= 20
30-
31- using __standard_header_ccomplex
32- _LIBCPP_DEPRECATED_ (" removed in C++20. Include <complex> instead." ) _LIBCPP_NODEBUG = void;
33- using __use_standard_header_ccomplex _LIBCPP_NODEBUG = __standard_header_ccomplex;
34-
35- # elif _LIBCPP_STD_VER >= 17
36-
37- using __standard_header_ccomplex _LIBCPP_DEPRECATED_ (" Include <complex> instead." ) _LIBCPP_NODEBUG = void;
38- using __use_standard_header_ccomplex _LIBCPP_NODEBUG = __standard_header_ccomplex;
39-
29+ # if _LIBCPP_STD_VER >= 17 && _LIBCPP_DIAGNOSE_DEPRECATED_HEADERS
30+ # warning <ccomplex> is removed in C++20. Include <complex> instead.
4031# endif
32+
4133#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
4234
4335#endif // _LIBCPP_CCOMPLEX
Original file line number Diff line number Diff line change 2424# pragma GCC system_header
2525# endif
2626
27- # if _LIBCPP_STD_VER >= 20
28-
29- using __standard_header_ciso646
30- _LIBCPP_DEPRECATED_ (" removed in C++20. Include <version> instead." ) _LIBCPP_NODEBUG = void;
31- using __use_standard_header_ciso646 _LIBCPP_NODEBUG = __standard_header_ciso646;
32-
27+ # if _LIBCPP_STD_VER >= 20 && _LIBCPP_DIAGNOSE_DEPRECATED_HEADERS
28+ # warning <ciso646> is removed in C++20. Include <version> instead.
3329# endif
30+
3431#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
3532
3633#endif // _LIBCPP_CISO646
Original file line number Diff line number Diff line change @@ -43,17 +43,10 @@ Macros:
4343# undef __alignof_is_defined
4444# define __alignof_is_defined 1
4545
46- # if _LIBCPP_STD_VER >= 20
47-
48- using __standard_header_cstdalign _LIBCPP_DEPRECATED_ (" removed in C++20." ) _LIBCPP_NODEBUG = void;
49- using __use_standard_header_cstdalign _LIBCPP_NODEBUG = __standard_header_cstdalign;
50-
51- # elif _LIBCPP_STD_VER >= 17
52-
53- using __standard_header_cstdalign _LIBCPP_DEPRECATED _LIBCPP_NODEBUG = void ;
54- using __use_standard_header_cstdalign _LIBCPP_NODEBUG = __standard_header_cstdalign;
55-
46+ # if _LIBCPP_STD_VER >= 17 && _LIBCPP_DIAGNOSE_DEPRECATED_HEADERS
47+ # warning <cstdalign> is removed in C++20.
5648# endif
49+
5750#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
5851
5952#endif // _LIBCPP_CSTDALIGN
Original file line number Diff line number Diff line change @@ -31,17 +31,10 @@ Macros:
3131# undef __bool_true_false_are_defined
3232# define __bool_true_false_are_defined 1
3333
34- # if _LIBCPP_STD_VER >= 20
35-
36- using __standard_header_cstdbool _LIBCPP_DEPRECATED_ (" removed in C++20." ) _LIBCPP_NODEBUG = void;
37- using __use_standard_header_cstdbool _LIBCPP_NODEBUG = __standard_header_cstdbool;
38-
39- # elif _LIBCPP_STD_VER >= 17
40-
41- using __standard_header_cstdbool _LIBCPP_DEPRECATED _LIBCPP_NODEBUG = void ;
42- using __use_standard_header_cstdbool _LIBCPP_NODEBUG = __standard_header_cstdbool;
43-
34+ # if _LIBCPP_STD_VER >= 17 && _LIBCPP_DIAGNOSE_DEPRECATED_HEADERS
35+ # warning <cstdbool> is removed in C++20.
4436# endif
37+
4538#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
4639
4740#endif // _LIBCPP_CSTDBOOL
Original file line number Diff line number Diff line change 2828# pragma GCC system_header
2929# endif
3030
31- # if _LIBCPP_STD_VER >= 20
32-
33- using __standard_header_ctgmath
34- _LIBCPP_DEPRECATED_ (" removed in C++20. Include <cmath> and <complex> instead." ) _LIBCPP_NODEBUG = void;
35- using __use_standard_header_ctgmath _LIBCPP_NODEBUG = __standard_header_ctgmath;
36-
37- # elif _LIBCPP_STD_VER >= 17
38-
39- using __standard_header_ctgmath _LIBCPP_DEPRECATED_ (" Include <cmath> and <complex> instead." ) _LIBCPP_NODEBUG = void;
40- using __use_standard_header_ctgmath _LIBCPP_NODEBUG = __standard_header_ctgmath;
41-
31+ # if _LIBCPP_STD_VER >= 17 && _LIBCPP_DIAGNOSE_DEPRECATED_HEADERS
32+ # warning <ctgmath> is removed in C++20. Include <cmath> and <complex> instead.
4233# endif
4334
4435#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
Original file line number Diff line number Diff line change 8989// UNSUPPORTED: LIBCXX-FREEBSD-FIXME
9090
9191// RUN: mkdir %t
92- // RUN: %{{cxx}} %s %{{flags}} %{{compile_flags}} --trace-includes -fshow-skipped-includes --preprocess > /dev/null 2> %t/trace-includes.txt
92+ // RUN: %{{cxx}} %s %{{flags}} %{{compile_flags}} -Wno-deprecated - -trace-includes -fshow-skipped-includes --preprocess > /dev/null 2> %t/trace-includes.txt
9393// RUN: %{{python}} %{{libcxx-dir}}/test/libcxx/transitive_includes/to_csv.py %t/trace-includes.txt > %t/actual_transitive_includes.csv
9494// RUN: cat %{{libcxx-dir}}/test/libcxx/transitive_includes/%{{cxx_std}}.csv | awk '/^{ escaped_header } / {{ print }}' > %t/expected_transitive_includes.csv
9595// RUN: diff -w %t/expected_transitive_includes.csv %t/actual_transitive_includes.csv
Original file line number Diff line number Diff line change 1414// UNSUPPORTED: c++03, c++11, c++14
1515// UNSUPPORTED: clang-modules-build
1616
17- #include " test_macros.h"
18-
1917#include < ccomplex>
2018
21- #if TEST_STD_VER >= 20
22- // expected-warning@ccomplex:* {{'__standard_header_ccomplex' is deprecated: removed in C++20. Include <complex> instead.}}
23- #else
24- // expected-warning@ccomplex:* {{'__standard_header_ccomplex' is deprecated: Include <complex> instead.}}
25- #endif
19+ // expected-warning@ccomplex:* {{<ccomplex> is removed in C++20. Include <complex> instead.}}
Original file line number Diff line number Diff line change 1515// UNSUPPORTED: clang-modules-build
1616
1717#include < ciso646>
18- // expected-warning@ciso646:* {{'__standard_header_ciso646' is deprecated: removed in C++20. Include <version> instead.}}
18+
19+ // expected-warning@ciso646:* {{<ciso646> is removed in C++20. Include <version> instead.}}
Original file line number Diff line number Diff line change 1414// UNSUPPORTED: c++03, c++11, c++14
1515// UNSUPPORTED: clang-modules-build
1616
17- #include " test_macros.h"
18-
1917#include < cstdalign>
2018
21- #if TEST_STD_VER >= 20
22- // expected-warning@cstdalign:* {{'__standard_header_cstdalign' is deprecated: removed in C++20.}}
23- #else
24- // expected-warning@cstdalign:* {{'__standard_header_cstdalign' is deprecated}}
25- #endif
19+ // expected-warning@cstdalign:* {{<cstdalign> is removed in C++20.}}
You can’t perform that action at this time.
0 commit comments