Skip to content

Commit 939ba0b

Browse files
committed
Add tests for the absence of feature test macros for features we don't
support yet.
1 parent b4c63ef commit 939ba0b

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

clang/test/Lexer/cxx-features.cpp

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,30 @@
2828

2929
// --- C++20 features ---
3030

31+
#if check(aggregate_paren_init, 0, 0, 0, 0, 0)
32+
// FIXME: 201902 in C++20
33+
#error "wrong value for __cpp_aggregate_paren_init"
34+
#endif
35+
3136
#if defined(CHAR8_T) ? check(char8_t, 201811, 201811, 201811, 201811, 201811) : \
3237
defined(NO_CHAR8_T) ? check(char8_t, 0, 0, 0, 0, 0) : \
3338
check(char8_t, 0, 0, 0, 0, 201811)
3439
#error "wrong value for __cpp_char8_t"
3540
#endif
3641

42+
#if check(concepts, 0, 0, 0, 0, 201907)
43+
#error "wrong value for __cpp_concepts"
44+
#endif
45+
3746
#if check(conditional_explicit, 0, 0, 0, 0, 201806)
3847
#error "wrong value for __cpp_conditional_explicit"
3948
#endif
4049

50+
#if check(consteval, 0, 0, 0, 0, 0)
51+
// FIXME: 201811 in C++20
52+
#error "wrong value for __cpp_consteval"
53+
#endif
54+
4155
// constexpr checked below
4256

4357
#if check(constexpr_dynamic_alloc, 0, 0, 0, 0, 201907)
@@ -52,6 +66,8 @@
5266
#error "wrong value for __cpp_constinit"
5367
#endif
5468

69+
// deduction_guides checked below
70+
5571
#if check(designated_initializers, 0, 0, 0, 0, 201707)
5672
#error "wrong value for __cpp_designated_initializers"
5773
#endif
@@ -68,8 +84,14 @@
6884

6985
// init_captures checked below
7086

71-
#if check(concepts, 0, 0, 0, 0, 201907)
72-
#error "wrong value for __cpp_concepts"
87+
#if check(modules, 0, 0, 0, 0, 0)
88+
// FIXME: 201907 in C++20
89+
#error "wrong value for __cpp_modules"
90+
#endif
91+
92+
#if check(using_enum, 0, 0, 0, 0, 0)
93+
// FIXME: 201907 in C++20
94+
#error "wrong value for __cpp_using_enum"
7395
#endif
7496

7597
// --- C++17 features ---
@@ -113,6 +135,7 @@
113135
// static_assert checked below
114136

115137
#if check(deduction_guides, 0, 0, 0, 201703, 201703)
138+
// FIXME: 201907 in C++20
116139
#error "wrong value for __cpp_deduction_guides"
117140
#endif
118141

0 commit comments

Comments
 (0)