[llvm-branch-commits] [clang] 3442169 - Revert "[c++20] Mark class type NTTPs as done and start defining the feature test macro."

Tom Stellard via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Mar 2 20:05:04 PST 2021


Author: Richard Smith
Date: 2021-03-02T20:04:41-08:00
New Revision: 344216979213d841b72e44891871c031db622f5d

URL: https://github.com/llvm/llvm-project/commit/344216979213d841b72e44891871c031db622f5d
DIFF: https://github.com/llvm/llvm-project/commit/344216979213d841b72e44891871c031db622f5d.diff

LOG: Revert "[c++20] Mark class type NTTPs as done and start defining the feature test macro."

Some of the parts of this work were reverted; stop defining the feature
test macro for now.

This reverts commit b4c63ef6dd90dba9af26a111c9a78b121c5284b1.

(cherry picked from commit 564f5b0734bd5d265a0046e5ca9d08ae5bc303eb)

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp
index d47ad1b74649..c64a912ce919 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",
-                        LangOpts.CPlusPlus20 ? "201911L" : "201411L");
+                        "201411L"); // (not latest)
     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 f57faed4ed90..2f46f354ee83 100644
--- a/clang/test/Lexer/cxx-features.cpp
+++ b/clang/test/Lexer/cxx-features.cpp
@@ -181,7 +181,8 @@
 #error "wrong value for __cpp_structured_bindings"
 #endif
 
-#if check(nontype_template_args, 0, 0, 0, 201411, 201911, 201911)
+#if check(nontype_template_args, 0, 0, 0, 201411, 201411, 201411)
+// FIXME: 201911 in C++20
 #error "wrong value for __cpp_nontype_template_args"
 #endif
 


        


More information about the llvm-branch-commits mailing list