Skip to content

Commit 81ea61b

Browse files
Try to fix undeprecation/deprecation verification
1 parent fdf253d commit 81ea61b

12 files changed

+49
-15
lines changed

libcxx/test/libcxx/clang_modules_include.gen.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
import sys
1919
sys.path.append(sys.argv[1])
20-
from libcxx.header_information import lit_header_restrictions, public_headers
20+
from libcxx.header_information import lit_header_restrictions, lit_header_undeprecations, public_headers
2121

2222
for header in public_headers:
2323
print(f"""\
@@ -41,6 +41,7 @@
4141
// UNSUPPORTED: LIBCXX-PICOLIBC-FIXME
4242
4343
{lit_header_restrictions.get(header, '')}
44+
{lit_header_undeprecations.get(header, '')}
4445
4546
#include <{header}>
4647
""")

libcxx/test/libcxx/double_include.gen.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@
1515

1616
import sys
1717
sys.path.append(sys.argv[1])
18-
from libcxx.header_information import lit_header_restrictions, public_headers
18+
from libcxx.header_information import lit_header_restrictions, lit_header_undeprecations, public_headers
1919

2020
for header in public_headers:
2121
print(f"""\
2222
//--- {header}.sh.cpp
2323
{lit_header_restrictions.get(header, '')}
24+
{lit_header_undeprecations.get(header, '')}
2425
2526
// RUN: %{{cxx}} -c %s -o %t.first.o %{{flags}} %{{compile_flags}}
2627
// RUN: %{{cxx}} -c %s -o %t.second.o -DWITH_MAIN %{{flags}} %{{compile_flags}}

libcxx/test/libcxx/header_inclusions.gen.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
import sys
1515
sys.path.append(sys.argv[1])
16-
from libcxx.header_information import lit_header_restrictions, public_headers, mandatory_inclusions
16+
from libcxx.header_information import lit_header_restrictions, lit_header_undeprecations, public_headers, mandatory_inclusions
1717

1818
for header in public_headers:
1919
header_guard = lambda h: f"_LIBCPP_{h.upper().replace('.', '_').replace('/', '_')}"
@@ -37,6 +37,7 @@
3737
print(f"""\
3838
//--- {header}.compile.pass.cpp
3939
{lit_header_restrictions.get(header, '')}
40+
{lit_header_undeprecations.get(header, '')}
4041
4142
#include <{header}>
4243
{checks}

libcxx/test/libcxx/libcpp_version.gen.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@
1212

1313
import sys
1414
sys.path.append(sys.argv[1])
15-
from libcxx.header_information import lit_header_restrictions, public_headers
15+
from libcxx.header_information import lit_header_restrictions, lit_header_undeprecations, public_headers
1616

1717
for header in public_headers:
1818
print(f"""\
1919
//--- {header}.compile.pass.cpp
2020
{lit_header_restrictions.get(header, '')}
21+
{lit_header_undeprecations.get(header, '')}
2122
2223
#include <{header}>
2324

libcxx/test/libcxx/no_assert_include.gen.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
import sys
1515
sys.path.append(sys.argv[1])
16-
from libcxx.header_information import lit_header_restrictions, public_headers
16+
from libcxx.header_information import lit_header_restrictions, lit_header_undeprecations, public_headers
1717

1818
for header in public_headers:
1919
if header == 'cassert':
@@ -22,6 +22,7 @@
2222
print(f"""\
2323
//--- {header}.compile.pass.cpp
2424
{lit_header_restrictions.get(header, '')}
25+
{lit_header_undeprecations.get(header, '')}
2526
2627
#include <{header}>
2728

libcxx/test/libcxx/system_reserved_names.gen.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,14 @@
1414

1515
import sys
1616
sys.path.append(sys.argv[1])
17-
from libcxx.header_information import lit_header_restrictions, public_headers
17+
from libcxx.header_information import lit_header_restrictions, lit_header_undeprecations, public_headers
1818

1919
for header in public_headers:
2020
print(
2121
f"""\
2222
//--- {header}.compile.pass.cpp
2323
{lit_header_restrictions.get(header, '')}
24+
{lit_header_undeprecations.get(header, '')}
2425
2526
#define SYSTEM_RESERVED_NAME This name should not be used in libc++
2627

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

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

1717
#if TEST_STD_VER >= 20
18-
# include <ccomplex> // expected-warning {{'__standard_header_ccomplex' is deprecated: removed in C++20}}
18+
// expected-warning {{'__standard_header_ccomplex' is deprecated: removed in C++20}}
19+
20+
# include <ccomplex>
1921
#else
20-
# include <ccomplex> // expected-warning {{'__standard_header_ccomplex' is deprecated}}
22+
// expected-warning {{'__standard_header_ccomplex' is deprecated}}
23+
24+
# include <ccomplex>
2125
#endif

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,6 @@
1414

1515
#include "test_macros.h"
1616

17-
#include <ciso646> // expected-warning {{'__standard_header_ciso646' is deprecated: removed in C++20}}
17+
// expected-warning {{'__standard_header_ciso646' is deprecated: removed in C++20}}
18+
19+
#include <ciso646>

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

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

1717
#if TEST_STD_VER >= 20
18-
# include <cstdalign> // expected-warning {{'__standard_header_cstdalign' is deprecated: removed in C++20}}
18+
// expected-warning {{'__standard_header_cstdalign' is deprecated: removed in C++20}}
19+
20+
# include <cstdalign>
1921
#else
20-
# include <cstdalign> // expected-warning {{'__standard_header_cstdalign' is deprecated}}
22+
// expected-warning {{'__standard_header_cstdalign' is deprecated}}
23+
24+
# include <cstdalign>
2125
#endif

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

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

1717
#if TEST_STD_VER >= 20
18-
# include <cstdbool> // expected-warning {{'__standard_header_cstdbool' is deprecated: removed in C++20}}
18+
// expected-warning {{'__standard_header_cstdbool' is deprecated: removed in C++20}}
19+
20+
# include <cstdbool>
1921
#else
20-
# include <cstdbool> // expected-warning {{'__standard_header_cstdbool' is deprecated}}
22+
// expected-warning {{'__standard_header_cstdbool' is deprecated}}
23+
24+
# include <cstdbool>
2125
#endif

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

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

1717
#if TEST_STD_VER >= 20
18-
# include <ctgmath> // expected-warning {{'__standard_header_ctgmath' is deprecated: removed in C++20}}
18+
// expected-warning {{'__standard_header_ccomplex' is deprecated: removed in C++20}}
19+
// expected-warning {{'__standard_header_ctgmath' is deprecated: removed in C++20}}
20+
21+
# include <ctgmath>
1922
#else
20-
# include <ctgmath> // expected-warning {{'__standard_header_ctgmath' is deprecated}}
23+
// expected-warning {{'__standard_header_ccomplex' is deprecated}}
24+
// expected-warning {{'__standard_header_ctgmath' is deprecated}}
25+
26+
# include <ctgmath>
2127
#endif

libcxx/utils/libcxx/header_information.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,14 @@
7070
"wchar.h": "// UNSUPPORTED: no-wide-characters",
7171
"wctype.h": "// UNSUPPORTED: no-wide-characters",
7272
}
73+
# Undeprecate headers that are deprecated in C++17 and removed in C++20.
74+
lit_header_undeprecations = {
75+
"ccomplex": "// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS",
76+
"ciso646": "// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS",
77+
"cstdalign": "// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS",
78+
"cstdbool": "// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS",
79+
"ctgmath": "// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS",
80+
}
7381

7482
# This table was produced manually, by grepping the TeX source of the Standard's
7583
# library clauses for the string "#include". Each header's synopsis contains

0 commit comments

Comments
 (0)