Skip to content

Commit

Permalink
[clang] add C++ feature test macro for P2266 simpler implicit move
Browse files Browse the repository at this point in the history
The feature was implemented in D99005, but we forgot to add the test
macro.

Reviewed By: Quuxplusone

Differential Revision: https://reviews.llvm.org/D104984
  • Loading branch information
mizvekov committed Jun 26, 2021
1 parent 5955812 commit d6144c3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion clang/lib/Frontend/InitPreprocessor.cpp
Expand Up @@ -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");
Expand Down
4 changes: 4 additions & 0 deletions clang/test/Lexer/cxx-features.cpp
Expand Up @@ -31,6 +31,10 @@

// --- 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
Expand Down

0 comments on commit d6144c3

Please sign in to comment.