[clang] add C++ feature test macro for P2266 simpler implicit move
authorMatheus Izvekov <mizvekov@gmail.com>
Sat, 26 Jun 2021 00:11:41 +0000 (02:11 +0200)
committerMatheus Izvekov <mizvekov@gmail.com>
Sat, 26 Jun 2021 21:05:23 +0000 (23:05 +0200)
The feature was implemented in D99005, but we forgot to add the test
macro.

Reviewed By: Quuxplusone

Differential Revision: https://reviews.llvm.org/D104984

clang/lib/Frontend/InitPreprocessor.cpp
clang/test/Lexer/cxx-features.cpp

index af1196f..bca0bb4 100644 (file)
@@ -597,8 +597,10 @@ static void InitializeCPlusPlusFeatureTestMacros(const LangOptions &LangOpts,
     Builder.defineMacro("__cpp_using_enum", "201907L");
   }
   // C++2b features.
-  if (LangOpts.CPlusPlus2b)
+  if (LangOpts.CPlusPlus2b) {
+    Builder.defineMacro("__cpp_implicit_move", "202011L");
     Builder.defineMacro("__cpp_size_t_suffix", "202011L");
+  }
   if (LangOpts.Char8)
     Builder.defineMacro("__cpp_char8_t", "201811L");
   Builder.defineMacro("__cpp_impl_destroying_delete", "201806L");
index 8f283dd..40c73f6 100644 (file)
 
 // --- C++2b features ---
 
+#if check(implicit_move, 0, 0, 0, 0, 0, 202011)
+#error "wrong value for __cpp_implicit_move"
+#endif
+
 #if check(size_t_suffix, 0, 0, 0, 0, 0, 202011)
 #error "wrong value for __cpp_size_t_suffix"
 #endif