This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGd6144c30fb6a: [clang] add C++ feature test macro for P2266 simpler implicit move (authored by mizvekov).
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D104984/new/ https://reviews.llvm.org/D104984 Files: clang/lib/Frontend/InitPreprocessor.cpp clang/test/Lexer/cxx-features.cpp Index: clang/test/Lexer/cxx-features.cpp =================================================================== --- clang/test/Lexer/cxx-features.cpp +++ clang/test/Lexer/cxx-features.cpp @@ -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 Index: clang/lib/Frontend/InitPreprocessor.cpp =================================================================== --- clang/lib/Frontend/InitPreprocessor.cpp +++ clang/lib/Frontend/InitPreprocessor.cpp @@ -597,8 +597,10 @@ 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: clang/test/Lexer/cxx-features.cpp =================================================================== --- clang/test/Lexer/cxx-features.cpp +++ clang/test/Lexer/cxx-features.cpp @@ -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 Index: clang/lib/Frontend/InitPreprocessor.cpp =================================================================== --- clang/lib/Frontend/InitPreprocessor.cpp +++ clang/lib/Frontend/InitPreprocessor.cpp @@ -597,8 +597,10 @@ 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");
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits