Author: Richard Smith Date: 2020-12-18T13:42:23-08:00 New Revision: b4c63ef6dd90dba9af26a111c9a78b121c5284b1
URL: https://github.com/llvm/llvm-project/commit/b4c63ef6dd90dba9af26a111c9a78b121c5284b1 DIFF: https://github.com/llvm/llvm-project/commit/b4c63ef6dd90dba9af26a111c9a78b121c5284b1.diff LOG: [c++20] Mark class type NTTPs as done and start defining the feature test macro. Added: Modified: clang/lib/Frontend/InitPreprocessor.cpp clang/test/Lexer/cxx-features.cpp clang/www/cxx_status.html Removed: ################################################################################ diff --git a/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp index f2c8d0f6b59a..d4b77a65aa63 100644 --- a/clang/lib/Frontend/InitPreprocessor.cpp +++ b/clang/lib/Frontend/InitPreprocessor.cpp @@ -565,7 +565,7 @@ static void InitializeCPlusPlusFeatureTestMacros(const LangOptions &LangOpts, Builder.defineMacro("__cpp_aggregate_bases", "201603L"); Builder.defineMacro("__cpp_structured_bindings", "201606L"); Builder.defineMacro("__cpp_nontype_template_args", - "201411L"); // (not latest) + LangOpts.CPlusPlus20 ? "201911L" : "201411L"); Builder.defineMacro("__cpp_fold_expressions", "201603L"); Builder.defineMacro("__cpp_guaranteed_copy_elision", "201606L"); Builder.defineMacro("__cpp_nontype_template_parameter_auto", "201606L"); diff --git a/clang/test/Lexer/cxx-features.cpp b/clang/test/Lexer/cxx-features.cpp index 8b9cb5434730..afc3b56d8a37 100644 --- a/clang/test/Lexer/cxx-features.cpp +++ b/clang/test/Lexer/cxx-features.cpp @@ -155,7 +155,7 @@ #error "wrong value for __cpp_structured_bindings" #endif -#if check(nontype_template_args, 0, 0, 0, 201411, 201411) +#if check(nontype_template_args, 0, 0, 0, 201411, 201911) #error "wrong value for __cpp_nontype_template_args" #endif diff --git a/clang/www/cxx_status.html b/clang/www/cxx_status.html index 4a66b7f9465e..923b13db73a6 100755 --- a/clang/www/cxx_status.html +++ b/clang/www/cxx_status.html @@ -1005,7 +1005,7 @@ <h2 id="cxx20">C++20 implementation status</h2> <tr> <td rowspan="2">Class types as non-type template parameters</td> <td><a href="https://wg21.link/p0732r2">P0732R2</a></td> - <td rowspan="2" class="none" align="center">No</td> + <td rowspan="2" class="svn" align="center">Clang 12</td> </tr> <tr> <!-- from Belfast --> <td><a href="https://wg21.link/p1907r1">P1907R1</a></td> _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits