Skip to content

Commit b68ee90

Browse files
Reorganize inclusion per P0063R3 to reduce deprecation warnings
1 parent 18c7e9d commit b68ee90

File tree

4 files changed

+17
-5
lines changed

4 files changed

+17
-5
lines changed

libcxx/include/complex.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@
2424
#endif
2525

2626
#ifdef __cplusplus
27-
# include <ccomplex>
27+
# if _LIBCPP_STD_VER >= 17
28+
# include <complex>
29+
# else
30+
# include <ccomplex>
31+
# endif
2832
#elif __has_include_next(<complex.h>)
2933
# include_next <complex.h>
3034
#endif

libcxx/include/ctgmath

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@
1818
1919
*/
2020

21-
#include <ccomplex>
21+
#if _LIBCPP_STD_VER >= 17
22+
# include <complex>
23+
#else
24+
# include <ccomplex>
25+
#endif
26+
2227
#include <cmath>
2328

2429
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)

libcxx/include/tgmath.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,12 @@
2424
#endif
2525

2626
#ifdef __cplusplus
27-
# include <ctgmath>
27+
# if _LIBCPP_STD_VER >= 17
28+
# include <complex>
29+
# include <cmath>
30+
# else
31+
# include <ctgmath>
32+
# endif
2833
#else
2934
# if __has_include_next(<tgmath.h>)
3035
# include_next <tgmath.h>

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,10 @@
1515
#include "test_macros.h"
1616

1717
#if TEST_STD_VER >= 20
18-
// expected-warning {{'__standard_header_ccomplex' is deprecated: removed in C++20}}
1918
// expected-warning {{'__standard_header_ctgmath' is deprecated: removed in C++20}}
2019

2120
# include <ctgmath>
2221
#else
23-
// expected-warning {{'__standard_header_ccomplex' is deprecated}}
2422
// expected-warning {{'__standard_header_ctgmath' is deprecated}}
2523

2624
# include <ctgmath>

0 commit comments

Comments
 (0)