From 344216979213d841b72e44891871c031db622f5d Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Mon, 1 Mar 2021 12:17:10 -0800 Subject: 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) --- clang/lib/Frontend/InitPreprocessor.cpp | 2 +- clang/test/Lexer/cxx-features.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp index d47ad1b..c64a912 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 f57faed..2f46f35 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 -- cgit v1.1