summaryrefslogtreecommitdiff
path: root/test/Lexer
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2018-06-14 00:40:20 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2018-06-14 00:40:20 +0000
commit7652941f0aa0811a7ac205a74d3413a4e1ae08a4 (patch)
treeab74a7536a864fe936f2ad2a8cf7fda27207e7d8 /test/Lexer
parentb878dfda35d801834e4d97f3088b51b86acc73e2 (diff)
downloadclang-7652941f0aa0811a7ac205a74d3413a4e1ae08a4.tar.gz
P0096R5, P0941R2: Update to match latest feature test macro specification.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@334677 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Lexer')
-rw-r--r--test/Lexer/cxx-features.cpp31
1 files changed, 23 insertions, 8 deletions
diff --git a/test/Lexer/cxx-features.cpp b/test/Lexer/cxx-features.cpp
index a0058511eb..772fa26e96 100644
--- a/test/Lexer/cxx-features.cpp
+++ b/test/Lexer/cxx-features.cpp
@@ -1,9 +1,11 @@
// RUN: %clang_cc1 -std=c++98 -fcxx-exceptions -verify %s
// RUN: %clang_cc1 -std=c++11 -fcxx-exceptions -verify %s
-// RUN: %clang_cc1 -std=c++1y -fcxx-exceptions -fsized-deallocation -verify %s
// RUN: %clang_cc1 -std=c++14 -fcxx-exceptions -fsized-deallocation -verify %s
-// RUN: %clang_cc1 -std=c++1z -fcxx-exceptions -fsized-deallocation -verify %s
-// RUN: %clang_cc1 -std=c++1z -fcxx-exceptions -fsized-deallocation -fconcepts-ts -DCONCEPTS_TS=1 -verify %s
+// RUN: %clang_cc1 -std=c++17 -fcxx-exceptions -fsized-deallocation -verify %s
+// RUN: %clang_cc1 -std=c++2a -fcxx-exceptions -fsized-deallocation -verify %s
+//
+// RUN: %clang_cc1 -std=c++17 -fcxx-exceptions -fsized-deallocation -frelaxed-template-template-args -DRELAXED_TEMPLATE_TEMPLATE_ARGS=1 -verify %s
+// RUN: %clang_cc1 -std=c++17 -fcxx-exceptions -fsized-deallocation -fconcepts-ts -DCONCEPTS_TS=1 -verify %s
// RUN: %clang_cc1 -fno-rtti -fno-threadsafe-statics -verify %s -DNO_EXCEPTIONS -DNO_RTTI -DNO_THREADSAFE_STATICS -fsized-deallocation
// RUN: %clang_cc1 -fcoroutines-ts -DNO_EXCEPTIONS -DCOROUTINES -verify -fsized-deallocation %s
// RUN: %clang_cc1 -fchar8_t -DNO_EXCEPTIONS -DCHAR8_T -verify -fsized-deallocation %s
@@ -12,13 +14,13 @@
// FIXME using `defined` in a macro has undefined behavior.
#if __cplusplus < 201103L
-#define check(macro, cxx98, cxx11, cxx14, cxx1z) cxx98 == 0 ? defined(__cpp_##macro) : __cpp_##macro != cxx98
+#define check(macro, cxx98, cxx11, cxx14, cxx17) cxx98 == 0 ? defined(__cpp_##macro) : __cpp_##macro != cxx98
#elif __cplusplus < 201402L
-#define check(macro, cxx98, cxx11, cxx14, cxx1z) cxx11 == 0 ? defined(__cpp_##macro) : __cpp_##macro != cxx11
+#define check(macro, cxx98, cxx11, cxx14, cxx17) cxx11 == 0 ? defined(__cpp_##macro) : __cpp_##macro != cxx11
#elif __cplusplus < 201406L
-#define check(macro, cxx98, cxx11, cxx14, cxx1z) cxx14 == 0 ? defined(__cpp_##macro) : __cpp_##macro != cxx14
+#define check(macro, cxx98, cxx11, cxx14, cxx17) cxx14 == 0 ? defined(__cpp_##macro) : __cpp_##macro != cxx14
#else
-#define check(macro, cxx98, cxx11, cxx14, cxx1z) cxx1z == 0 ? defined(__cpp_##macro) : __cpp_##macro != cxx1z
+#define check(macro, cxx98, cxx11, cxx14, cxx17) cxx17 == 0 ? defined(__cpp_##macro) : __cpp_##macro != cxx17
#endif
// --- C++17 features ---
@@ -35,6 +37,10 @@
#error "wrong value for __cpp_aligned_new"
#endif
+#if check(guaranteed_copy_elision, 0, 0, 0, 201606)
+#error "wrong value for __cpp_guaranteed_copy_elision"
+#endif
+
#if check(noexcept_function_type, 0, 0, 0, 201510)
#error "wrong value for __cpp_noexcept_function_type"
#endif
@@ -61,6 +67,12 @@
#error "wrong value for __cpp_deduction_guides"
#endif
+#if check(nontype_template_parameter_auto, 0, 0, 0, 201606)
+#error "wrong value for __cpp_nontype_template_parameter_auto"
+#endif
+
+// This is the old name (from P0096R4) for
+// __cpp_nontype_template_parameter_auto
#if check(template_auto, 0, 0, 0, 201606)
#error "wrong value for __cpp_template_auto"
#endif
@@ -75,6 +87,7 @@
#error "wrong value for __cpp_enumerator_attributes"
#endif
+// This is an old name (from P0096R4), now removed from SD-6.
#if check(nested_namespace_definitions, 0, 0, 0, 201411)
#error "wrong value for __cpp_nested_namespace_definitions"
#endif
@@ -97,7 +110,9 @@
#error "wrong value for __cpp_nontype_template_args"
#endif
-#if check(template_template_args, 0, 0, 0, 0) // FIXME: should be 201611 when feature is enabled
+#if defined(RELAXED_TEMPLATE_TEMPLATE_ARGS) \
+ ? check(template_template_args, 0, 0, 0, 201611) \
+ : check(template_template_args, 0, 0, 0, 0)
#error "wrong value for __cpp_template_template_args"
#endif