diff options
author | Richard Smith <richard@metafoo.co.uk> | 2020-12-18 13:11:01 -0800 |
---|---|---|
committer | Richard Smith <richard@metafoo.co.uk> | 2020-12-18 13:42:23 -0800 |
commit | 939ba0b501b27a2535c9bb62b6f6dc027d49f76d (patch) | |
tree | f8a45ce265865c8b54c521c830570bd24e943a9b /clang/test/Lexer/cxx-features.cpp | |
parent | b4c63ef6dd90dba9af26a111c9a78b121c5284b1 (diff) | |
download | llvm-939ba0b501b27a2535c9bb62b6f6dc027d49f76d.zip llvm-939ba0b501b27a2535c9bb62b6f6dc027d49f76d.tar.gz llvm-939ba0b501b27a2535c9bb62b6f6dc027d49f76d.tar.bz2 |
Add tests for the absence of feature test macros for features we don't
support yet.
Diffstat (limited to 'clang/test/Lexer/cxx-features.cpp')
-rw-r--r-- | clang/test/Lexer/cxx-features.cpp | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/clang/test/Lexer/cxx-features.cpp b/clang/test/Lexer/cxx-features.cpp index afc3b56..852c534 100644 --- a/clang/test/Lexer/cxx-features.cpp +++ b/clang/test/Lexer/cxx-features.cpp @@ -28,16 +28,30 @@ // --- C++20 features --- +#if check(aggregate_paren_init, 0, 0, 0, 0, 0) +// FIXME: 201902 in C++20 +#error "wrong value for __cpp_aggregate_paren_init" +#endif + #if defined(CHAR8_T) ? check(char8_t, 201811, 201811, 201811, 201811, 201811) : \ defined(NO_CHAR8_T) ? check(char8_t, 0, 0, 0, 0, 0) : \ check(char8_t, 0, 0, 0, 0, 201811) #error "wrong value for __cpp_char8_t" #endif +#if check(concepts, 0, 0, 0, 0, 201907) +#error "wrong value for __cpp_concepts" +#endif + #if check(conditional_explicit, 0, 0, 0, 0, 201806) #error "wrong value for __cpp_conditional_explicit" #endif +#if check(consteval, 0, 0, 0, 0, 0) +// FIXME: 201811 in C++20 +#error "wrong value for __cpp_consteval" +#endif + // constexpr checked below #if check(constexpr_dynamic_alloc, 0, 0, 0, 0, 201907) @@ -52,6 +66,8 @@ #error "wrong value for __cpp_constinit" #endif +// deduction_guides checked below + #if check(designated_initializers, 0, 0, 0, 0, 201707) #error "wrong value for __cpp_designated_initializers" #endif @@ -68,8 +84,14 @@ // init_captures checked below -#if check(concepts, 0, 0, 0, 0, 201907) -#error "wrong value for __cpp_concepts" +#if check(modules, 0, 0, 0, 0, 0) +// FIXME: 201907 in C++20 +#error "wrong value for __cpp_modules" +#endif + +#if check(using_enum, 0, 0, 0, 0, 0) +// FIXME: 201907 in C++20 +#error "wrong value for __cpp_using_enum" #endif // --- C++17 features --- @@ -113,6 +135,7 @@ // static_assert checked below #if check(deduction_guides, 0, 0, 0, 201703, 201703) +// FIXME: 201907 in C++20 #error "wrong value for __cpp_deduction_guides" #endif |