diff --git a/clang-tools-extra/clang-tidy/readability/RedundantStringCStrCheck.cpp b/clang-tools-extra/clang-tidy/readability/RedundantStringCStrCheck.cpp --- a/clang-tools-extra/clang-tidy/readability/RedundantStringCStrCheck.cpp +++ b/clang-tools-extra/clang-tidy/readability/RedundantStringCStrCheck.cpp @@ -78,7 +78,7 @@ Options.get("StringParameterFunctions", ""))) { if (getLangOpts().CPlusPlus20) StringParameterFunctions.push_back("::std::format"); - if (getLangOpts().CPlusPlus2b) + if (getLangOpts().CPlusPlus23) StringParameterFunctions.push_back("::std::print"); } diff --git a/clang-tools-extra/clangd/index/StdLib.cpp b/clang-tools-extra/clangd/index/StdLib.cpp --- a/clang-tools-extra/clangd/index/StdLib.cpp +++ b/clang-tools-extra/clangd/index/StdLib.cpp @@ -47,8 +47,8 @@ LangStandard::Kind standardFromOpts(const LangOptions &LO) { if (LO.CPlusPlus) { - if (LO.CPlusPlus2b) - return LangStandard::lang_cxx2b; + if (LO.CPlusPlus23) + return LangStandard::lang_cxx23; if (LO.CPlusPlus20) return LangStandard::lang_cxx20; if (LO.CPlusPlus17) diff --git a/clang/docs/CommandGuide/clang.rst b/clang/docs/CommandGuide/clang.rst --- a/clang/docs/CommandGuide/clang.rst +++ b/clang/docs/CommandGuide/clang.rst @@ -193,13 +193,13 @@ ISO C++ 2020 with amendments and GNU extensions - | ``c++2b`` + | ``c++23`` - Working draft for ISO C++ 2023 + ISO C++ 2023 with amendments - | ``gnu++2b`` + | ``gnu++23`` - Working draft for ISO C++ 2023 with GNU extensions + ISO C++ 2023 with amendments and GNU extensions The default C++ language standard is ``gnu++17``. diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst --- a/clang/docs/ReleaseNotes.rst +++ b/clang/docs/ReleaseNotes.rst @@ -93,7 +93,7 @@ error again in the future once there is a less fragile way to mark a module as being part of the implementation rather than a user module. -C++2b Feature Support +C++23 Feature Support ^^^^^^^^^^^^^^^^^^^^^ - Implemented `P2036R3: Change scope of lambda trailing-return-type `_ @@ -181,6 +181,8 @@ New Compiler Flags ------------------ +- The flag ``-std=c++23`` has been added. This behaves the same as the existing + flag ``-std=c++2b``. Deprecated Compiler Flags ------------------------- @@ -386,7 +388,7 @@ (`#58674 `_) - Fix incorrect deletion of the default constructor of unions in some cases. (`#48416 `_) -- No longer issue a pre-C++2b compatibility warning in ``-pedantic`` mode +- No longer issue a pre-C++23 compatibility warning in ``-pedantic`` mode regading overloaded `operator[]` with more than one parmeter or for static lambdas. (`#61582 `_) - Stop stripping CV qualifiers from the type of ``this`` when capturing it by value in diff --git a/clang/docs/StandardCPlusPlusModules.rst b/clang/docs/StandardCPlusPlusModules.rst --- a/clang/docs/StandardCPlusPlusModules.rst +++ b/clang/docs/StandardCPlusPlusModules.rst @@ -434,7 +434,7 @@ .. code-block:: console $ clang++ -std=c++20 M.cppm --precompile -o M.pcm - $ clang++ -std=c++2b Use.cpp -fprebuilt-module-path=. + $ clang++ -std=c++23 Use.cpp -fprebuilt-module-path=. The compiler would reject the example due to the inconsistent language options. Not all options are language options. @@ -611,7 +611,7 @@ Please see https://github.com/llvm/llvm-project/labels/clang%3Amodules for more issues or file a new issue if you don't find an existing one. If you're going to create a new issue for standard C++ modules, -please start the title with ``[C++20] [Modules]`` (or ``[C++2b] [Modules]``, etc) +please start the title with ``[C++20] [Modules]`` (or ``[C++23] [Modules]``, etc) and add the label ``clang:modules`` (if you have permissions for that). For higher level support for proposals, you could visit https://clang.llvm.org/cxx_status.html. diff --git a/clang/include/clang/Basic/DiagnosticCommonKinds.td b/clang/include/clang/Basic/DiagnosticCommonKinds.td --- a/clang/include/clang/Basic/DiagnosticCommonKinds.td +++ b/clang/include/clang/Basic/DiagnosticCommonKinds.td @@ -210,14 +210,14 @@ def warn_cxx98_compat_longlong : Warning< "'long long' is incompatible with C++98">, InGroup, DefaultIgnore; -def ext_cxx2b_size_t_suffix : ExtWarn< - "'size_t' suffix for literals is a C++2b extension">, - InGroup; +def ext_cxx23_size_t_suffix : ExtWarn< + "'size_t' suffix for literals is a C++23 extension">, + InGroup; def warn_cxx20_compat_size_t_suffix : Warning< "'size_t' suffix for literals is incompatible with C++ standards before " - "C++2b">, InGroup, DefaultIgnore; -def err_cxx2b_size_t_suffix: Error< - "'size_t' suffix for literals is a C++2b feature">; + "C++23">, InGroup, DefaultIgnore; +def err_cxx23_size_t_suffix: Error< + "'size_t' suffix for literals is a C++23 feature">; def err_size_t_literal_too_large: Error< "%select{signed |}0'size_t' literal is out of range of possible " "%select{signed |}0'size_t' values">; diff --git a/clang/include/clang/Basic/DiagnosticGroups.td b/clang/include/clang/Basic/DiagnosticGroups.td --- a/clang/include/clang/Basic/DiagnosticGroups.td +++ b/clang/include/clang/Basic/DiagnosticGroups.td @@ -304,9 +304,9 @@ [CXXPre20Compat]>; def : DiagGroup<"c++98-c++11-c++14-c++17-compat-pedantic", [CXXPre20CompatPedantic]>; -def CXXPre2bCompat : DiagGroup<"pre-c++2b-compat">; -def CXXPre2bCompatPedantic : - DiagGroup<"pre-c++2b-compat-pedantic", [CXXPre2bCompat]>; +def CXXPre23Compat : DiagGroup<"pre-c++23-compat">; +def CXXPre23CompatPedantic : + DiagGroup<"pre-c++23-compat-pedantic", [CXXPre23Compat]>; def CXX98CompatBindToTemporaryCopy : DiagGroup<"c++98-compat-bind-to-temporary-copy">; @@ -321,7 +321,7 @@ CXXPre14Compat, CXXPre17Compat, CXXPre20Compat, - CXXPre2bCompat]>; + CXXPre23Compat]>; // Warnings for C++11 features which are Extensions in C++98 mode. def CXX98CompatPedantic : DiagGroup<"c++98-compat-pedantic", [CXX98Compat, @@ -330,7 +330,7 @@ CXXPre14CompatPedantic, CXXPre17CompatPedantic, CXXPre20CompatPedantic, - CXXPre2bCompatPedantic]>; + CXXPre23CompatPedantic]>; def CXX11Narrowing : DiagGroup<"c++11-narrowing">; @@ -360,39 +360,39 @@ CXXPre14Compat, CXXPre17Compat, CXXPre20Compat, - CXXPre2bCompat]>; + CXXPre23Compat]>; def : DiagGroup<"c++0x-compat", [CXX11Compat]>; def CXX11CompatPedantic : DiagGroup<"c++11-compat-pedantic", [CXX11Compat, CXXPre14CompatPedantic, CXXPre17CompatPedantic, CXXPre20CompatPedantic, - CXXPre2bCompatPedantic]>; + CXXPre23CompatPedantic]>; def CXX14Compat : DiagGroup<"c++14-compat", [CXXPre17Compat, CXXPre20Compat, - CXXPre2bCompat]>; + CXXPre23Compat]>; def CXX14CompatPedantic : DiagGroup<"c++14-compat-pedantic", [CXX14Compat, CXXPre17CompatPedantic, CXXPre20CompatPedantic, - CXXPre2bCompatPedantic]>; + CXXPre23CompatPedantic]>; def CXX17Compat : DiagGroup<"c++17-compat", [DeprecatedRegister, DeprecatedIncrementBool, CXX17CompatMangling, CXXPre20Compat, - CXXPre2bCompat]>; + CXXPre23Compat]>; def CXX17CompatPedantic : DiagGroup<"c++17-compat-pedantic", [CXX17Compat, CXXPre20CompatPedantic, - CXXPre2bCompatPedantic]>; + CXXPre23CompatPedantic]>; def : DiagGroup<"c++1z-compat", [CXX17Compat]>; -def CXX20Compat : DiagGroup<"c++20-compat", [CXXPre2bCompat]>; +def CXX20Compat : DiagGroup<"c++20-compat", [CXXPre23Compat]>; def CXX20CompatPedantic : DiagGroup<"c++20-compat-pedantic", [CXX20Compat, - CXXPre2bCompatPedantic]>; + CXXPre23CompatPedantic]>; def : DiagGroup<"c++2a-compat", [CXX20Compat]>; def : DiagGroup<"c++2a-compat-pedantic", [CXX20CompatPedantic]>; @@ -1108,9 +1108,9 @@ // earlier C++ versions. def CXX20 : DiagGroup<"c++20-extensions", [CXX20Designator, CXX20Attrs]>; -// A warning group for warnings about using C++2b features as extensions in +// A warning group for warnings about using C++23 features as extensions in // earlier C++ versions. -def CXX2b : DiagGroup<"c++2b-extensions">; +def CXX23 : DiagGroup<"c++23-extensions">; def : DiagGroup<"c++0x-extensions", [CXX11]>; def : DiagGroup<"c++1y-extensions", [CXX14]>; diff --git a/clang/include/clang/Basic/DiagnosticLexKinds.td b/clang/include/clang/Basic/DiagnosticLexKinds.td --- a/clang/include/clang/Basic/DiagnosticLexKinds.td +++ b/clang/include/clang/Basic/DiagnosticLexKinds.td @@ -138,13 +138,13 @@ def ext_delimited_escape_sequence : Extension< "%select{delimited|named}0 escape sequences are a " - "%select{Clang|C++2b}1 extension">, + "%select{Clang|C++23}1 extension">, InGroup>; -def warn_cxx2b_delimited_escape_sequence : Warning< +def warn_cxx23_delimited_escape_sequence : Warning< "%select{delimited|named}0 escape sequences are " - "incompatible with C++ standards before C++2b">, - InGroup, DefaultIgnore; + "incompatible with C++ standards before C++23">, + InGroup, DefaultIgnore; def err_delimited_escape_empty : Error< "delimited escape sequence cannot be empty">; @@ -396,10 +396,10 @@ "#include_next is a language extension">, InGroup; def ext_pp_warning_directive : Extension< - "#warning is a %select{C2x|C++2b}0 extension">; -def warn_cxx2b_compat_warning_directive : Warning< - "#warning is incompatible with C++ standards before C++2b">, - InGroup, DefaultIgnore; + "#warning is a %select{C2x|C++23}0 extension">; +def warn_cxx23_compat_warning_directive : Warning< + "#warning is incompatible with C++ standards before C++23">, + InGroup, DefaultIgnore; def warn_c2x_compat_warning_directive : Warning< "#warning is incompatible with C standards before C2x">, InGroup, DefaultIgnore; @@ -739,14 +739,14 @@ "use of a '#%select{|elifdef|elifndef}0' directive " "is a C2x extension">, InGroup; -def warn_cxx2b_compat_pp_directive : Warning< +def warn_cxx23_compat_pp_directive : Warning< "use of a '#%select{|elifdef|elifndef}0' directive " - "is incompatible with C++ standards before C++2b">, - InGroup, DefaultIgnore; -def ext_cxx2b_pp_directive : ExtWarn< + "is incompatible with C++ standards before C++23">, + InGroup, DefaultIgnore; +def ext_cxx23_pp_directive : ExtWarn< "use of a '#%select{|elifdef|elifndef}0' directive " - "is a C++2b extension">, - InGroup; + "is a C++23 extension">, + InGroup; def err_pp_visibility_non_macro : Error<"no macro named %0">; diff --git a/clang/include/clang/Basic/DiagnosticParseKinds.td b/clang/include/clang/Basic/DiagnosticParseKinds.td --- a/clang/include/clang/Basic/DiagnosticParseKinds.td +++ b/clang/include/clang/Basic/DiagnosticParseKinds.td @@ -300,14 +300,14 @@ "label at end of compound statement is a C2x extension">, InGroup; def ext_cxx_label_end_of_compound_statement : ExtWarn< - "label at end of compound statement is a C++2b extension">, - InGroup; + "label at end of compound statement is a C++23 extension">, + InGroup; def warn_c2x_compat_label_end_of_compound_statement : Warning< "label at end of compound statement is incompatible with C standards before C2x">, InGroup, DefaultIgnore; def warn_cxx20_compat_label_end_of_compound_statement : Warning< - "label at end of compound statement is incompatible with C++ standards before C++2b">, - InGroup, DefaultIgnore; + "label at end of compound statement is incompatible with C++ standards before C++23">, + InGroup, DefaultIgnore; def err_address_of_label_outside_fn : Error< "use of address-of-label extension outside of a function body">; def err_asm_operand_wide_string_literal : Error< @@ -566,11 +566,11 @@ def err_extraneous_rparen_in_condition : Error< "extraneous ')' after condition, expected a statement">; def ext_alias_in_init_statement : ExtWarn< - "alias declaration in this context is a C++2b extension">, - InGroup; + "alias declaration in this context is a C++23 extension">, + InGroup; def warn_cxx20_alias_in_init_statement : Warning< - "alias declaration in this context is incompatible with C++ standards before C++2b">, - DefaultIgnore, InGroup; + "alias declaration in this context is incompatible with C++ standards before C++23">, + DefaultIgnore, InGroup; def warn_dangling_else : Warning< "add explicit braces to avoid dangling else">, InGroup; @@ -652,11 +652,11 @@ "constexpr if is incompatible with C++ standards before C++17">, DefaultIgnore, InGroup; def ext_consteval_if : ExtWarn< - "consteval if is a C++2b extension">, - InGroup; + "consteval if is a C++23 extension">, + InGroup; def warn_cxx20_compat_consteval_if : Warning< - "consteval if is incompatible with C++ standards before C++2b">, - InGroup, DefaultIgnore; + "consteval if is incompatible with C++ standards before C++23">, + InGroup, DefaultIgnore; def ext_init_statement : ExtWarn< "'%select{if|switch}0' initialization statements are a C++17 extension">, @@ -1014,14 +1014,14 @@ def err_capture_default_first : Error< "capture default must be first">; def ext_decl_attrs_on_lambda : ExtWarn< - "an attribute specifier sequence in this position is a C++2b extension">, - InGroup; + "an attribute specifier sequence in this position is a C++23 extension">, + InGroup; def ext_lambda_missing_parens : ExtWarn< - "lambda without a parameter clause is a C++2b extension">, - InGroup; + "lambda without a parameter clause is a C++23 extension">, + InGroup; def warn_cxx20_compat_decl_attrs_on_lambda : Warning< "an attribute specifier sequence in this position is incompatible with C++ " - "standards before C++2b">, InGroup, DefaultIgnore; + "standards before C++23">, InGroup, DefaultIgnore; // C++17 lambda expressions def err_expected_star_this_capture : Error< @@ -1044,12 +1044,12 @@ def err_lambda_template_parameter_list_empty : Error< "lambda template parameter list cannot be empty">; -// C++2b static lambdas +// C++23 static lambdas def err_static_lambda: ExtWarn< - "static lambdas are a C++2b extension">, InGroup; + "static lambdas are a C++23 extension">, InGroup; def warn_cxx20_compat_static_lambda : Warning< - "static lambdas are incompatible with C++ standards before C++2b">, - InGroup, DefaultIgnore; + "static lambdas are incompatible with C++ standards before C++23">, + InGroup, DefaultIgnore; def err_static_mutable_lambda : Error< "lambda cannot be both mutable and static">; def err_static_lambda_captures : Error< diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td --- a/clang/include/clang/Basic/DiagnosticSemaKinds.td +++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td @@ -2370,7 +2370,7 @@ "%select{parenthesized|nested}0 initializer list">; def warn_cxx20_compat_auto_expr : Warning< "'auto' as a functional-style cast is incompatible with C++ standards " - "before C++2b">, InGroup, DefaultIgnore; + "before C++23">, InGroup, DefaultIgnore; def err_auto_missing_trailing_return : Error< "'auto' return without trailing return type; deduced return types are a " "C++14 extension">; @@ -2727,13 +2727,13 @@ "use of this statement in a constexpr %select{function|constructor}0 " "is incompatible with C++ standards before C++20">, InGroup, DefaultIgnore; -def ext_constexpr_body_invalid_stmt_cxx2b : ExtWarn< +def ext_constexpr_body_invalid_stmt_cxx23 : ExtWarn< "use of this statement in a constexpr %select{function|constructor}0 " - "is a C++2b extension">, InGroup; + "is a C++23 extension">, InGroup; def warn_cxx20_compat_constexpr_body_invalid_stmt : Warning< "use of this statement in a constexpr %select{function|constructor}0 " - "is incompatible with C++ standards before C++2b">, - InGroup, DefaultIgnore; + "is incompatible with C++ standards before C++23">, + InGroup, DefaultIgnore; def ext_constexpr_type_definition : ExtWarn< "type definition in a constexpr %select{function|constructor}0 " "is a C++14 extension">, InGroup; @@ -2754,15 +2754,15 @@ def ext_constexpr_static_var : ExtWarn< "definition of a %select{static|thread_local}1 variable " "in a constexpr %select{function|constructor}0 " - "is a C++2b extension">, InGroup; + "is a C++23 extension">, InGroup; def warn_cxx20_compat_constexpr_var : Warning< "definition of a %select{static variable|thread_local variable|variable " "of non-literal type}1 in a constexpr %select{function|constructor}0 " - "is incompatible with C++ standards before C++2b">, - InGroup, DefaultIgnore; + "is incompatible with C++ standards before C++23">, + InGroup, DefaultIgnore; def err_constexpr_local_var_non_literal_type : Error< "variable of non-literal type %1 cannot be defined in a constexpr " - "%select{function|constructor}0 before C++2b">; + "%select{function|constructor}0 before C++23">; def ext_constexpr_local_var_no_init : ExtWarn< "uninitialized variable in a constexpr %select{function|constructor}0 " "is a C++20 extension">, InGroup; @@ -6744,7 +6744,7 @@ def warn_deprecated_comma_subscript : Warning< "top-level comma expression in array subscript is deprecated " - "in C++20 and unsupported in C++2b">, + "in C++20 and unsupported in C++23">, InGroup; def ext_subscript_non_lvalue : Extension< @@ -9148,9 +9148,9 @@ def err_operator_overload_variadic : Error<"overloaded %0 cannot be variadic">; def warn_cxx20_compat_operator_overload_static : Warning< "declaring overloaded %0 as 'static' is incompatible with C++ standards " - "before C++2b">, InGroup, DefaultIgnore; + "before C++23">, InGroup, DefaultIgnore; def ext_operator_overload_static : ExtWarn< - "declaring overloaded %0 as 'static' is a C++2b extension">, InGroup; + "declaring overloaded %0 as 'static' is a C++23 extension">, InGroup; def err_operator_overload_static : Error< "overloaded %0 cannot be a static member function">; def err_operator_overload_default_arg : Error< @@ -9158,9 +9158,9 @@ def ext_subscript_overload : Warning< "overloaded %0 with %select{no|a defaulted|more than one}1 parameter is a " - "C++2b extension">, InGroup, DefaultIgnore; + "C++23 extension">, InGroup, DefaultIgnore; def error_subscript_overload : Error< - "overloaded %0 cannot have %select{no|a defaulted|more than one}1 parameter before C++2b">; + "overloaded %0 cannot have %select{no|a defaulted|more than one}1 parameter before C++23">; def err_operator_overload_must_be : Error< "overloaded %0 must be a %select{unary|binary|unary or binary}2 operator " diff --git a/clang/include/clang/Basic/LangOptions.def b/clang/include/clang/Basic/LangOptions.def --- a/clang/include/clang/Basic/LangOptions.def +++ b/clang/include/clang/Basic/LangOptions.def @@ -97,7 +97,7 @@ LANGOPT(CPlusPlus14 , 1, 0, "C++14") LANGOPT(CPlusPlus17 , 1, 0, "C++17") LANGOPT(CPlusPlus20 , 1, 0, "C++20") -LANGOPT(CPlusPlus2b , 1, 0, "C++2b") +LANGOPT(CPlusPlus23 , 1, 0, "C++23") LANGOPT(ObjC , 1, 0, "Objective-C") BENIGN_LANGOPT(ObjCDefaultSynthProperties , 1, 0, "Objective-C auto-synthesized properties") diff --git a/clang/include/clang/Basic/LangStandard.h b/clang/include/clang/Basic/LangStandard.h --- a/clang/include/clang/Basic/LangStandard.h +++ b/clang/include/clang/Basic/LangStandard.h @@ -55,7 +55,7 @@ CPlusPlus14 = (1 << 7), CPlusPlus17 = (1 << 8), CPlusPlus20 = (1 << 9), - CPlusPlus2b = (1 << 10), + CPlusPlus23 = (1 << 10), Digraphs = (1 << 11), GNUMode = (1 << 12), HexFloat = (1 << 13), @@ -118,8 +118,8 @@ /// isCPlusPlus20 - Language is a C++20 variant (or later). bool isCPlusPlus20() const { return Flags & CPlusPlus20; } - /// isCPlusPlus2b - Language is a post-C++20 variant (or later). - bool isCPlusPlus2b() const { return Flags & CPlusPlus2b; } + /// isCPlusPlus23 - Language is a post-C++23 variant (or later). + bool isCPlusPlus23() const { return Flags & CPlusPlus23; } /// hasDigraphs - Language supports digraphs. bool hasDigraphs() const { return Flags & Digraphs; } diff --git a/clang/include/clang/Basic/LangStandards.def b/clang/include/clang/Basic/LangStandards.def --- a/clang/include/clang/Basic/LangStandards.def +++ b/clang/include/clang/Basic/LangStandards.def @@ -151,15 +151,17 @@ CPlusPlus20 | Digraphs | HexFloat | GNUMode) LANGSTANDARD_ALIAS_DEPR(gnucxx20, "gnu++2a") -LANGSTANDARD(cxx2b, "c++2b", - CXX, "Working draft for ISO C++ 2023 DIS", +LANGSTANDARD(cxx23, "c++23", + CXX, "ISO C++ 2023 DIS", LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 | - CPlusPlus20 | CPlusPlus2b | Digraphs | HexFloat) + CPlusPlus20 | CPlusPlus23 | Digraphs | HexFloat) +LANGSTANDARD_ALIAS_DEPR(cxx23, "c++2b") -LANGSTANDARD(gnucxx2b, "gnu++2b", - CXX, "Working draft for ISO C++ 2023 DIS with GNU extensions", +LANGSTANDARD(gnucxx23, "gnu++23", + CXX, "ISO C++ 2023 DIS with GNU extensions", LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 | - CPlusPlus20 | CPlusPlus2b | Digraphs | HexFloat | GNUMode) + CPlusPlus20 | CPlusPlus23 | Digraphs | HexFloat | GNUMode) +LANGSTANDARD_ALIAS_DEPR(gnucxx23, "gnu++2b") // OpenCL LANGSTANDARD(opencl10, "cl1.0", diff --git a/clang/include/clang/Lex/LiteralSupport.h b/clang/include/clang/Lex/LiteralSupport.h --- a/clang/include/clang/Lex/LiteralSupport.h +++ b/clang/include/clang/Lex/LiteralSupport.h @@ -63,7 +63,7 @@ bool isUnsigned : 1; bool isLong : 1; // This is *not* set for long long. bool isLongLong : 1; - bool isSizeT : 1; // 1z, 1uz (C++2b) + bool isSizeT : 1; // 1z, 1uz (C++23) bool isHalf : 1; // 1.0h bool isFloat : 1; // 1.0f bool isImaginary : 1; // 1.0i diff --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h --- a/clang/include/clang/Sema/Sema.h +++ b/clang/include/clang/Sema/Sema.h @@ -1370,7 +1370,7 @@ return Context == ExpressionEvaluationContext::ImmediateFunctionContext || (Context == ExpressionEvaluationContext::DiscardedStatement && InImmediateFunctionContext) || - // C++2b [expr.const]p14: + // C++23 [expr.const]p14: // An expression or conversion is in an immediate function // context if it is potentially evaluated and either: // * its innermost enclosing non-block scope is a function diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp --- a/clang/lib/AST/ExprConstant.cpp +++ b/clang/lib/AST/ExprConstant.cpp @@ -5043,7 +5043,7 @@ static bool CheckLocalVariableDeclaration(EvalInfo &Info, const VarDecl *VD) { // An expression E is a core constant expression unless the evaluation of E - // would evaluate one of the following: [C++2b] - a control flow that passes + // would evaluate one of the following: [C++23] - a control flow that passes // through a declaration of a variable with static or thread storage duration // unless that variable is usable in constant expressions. if (VD->isLocalVarDecl() && VD->isStaticLocal() && diff --git a/clang/lib/Basic/LangOptions.cpp b/clang/lib/Basic/LangOptions.cpp --- a/clang/lib/Basic/LangOptions.cpp +++ b/clang/lib/Basic/LangOptions.cpp @@ -117,7 +117,7 @@ Opts.CPlusPlus14 = Std.isCPlusPlus14(); Opts.CPlusPlus17 = Std.isCPlusPlus17(); Opts.CPlusPlus20 = Std.isCPlusPlus20(); - Opts.CPlusPlus2b = Std.isCPlusPlus2b(); + Opts.CPlusPlus23 = Std.isCPlusPlus23(); Opts.GNUMode = Std.isGNUMode(); Opts.GNUCVersion = 0; Opts.HexFloats = Std.hasHexFloats(); diff --git a/clang/lib/Basic/Targets/OSTargets.cpp b/clang/lib/Basic/Targets/OSTargets.cpp --- a/clang/lib/Basic/Targets/OSTargets.cpp +++ b/clang/lib/Basic/Targets/OSTargets.cpp @@ -214,7 +214,8 @@ Builder.defineMacro("_HAS_CHAR16_T_LANGUAGE_SUPPORT", Twine(1)); if (Opts.isCompatibleWithMSVC(LangOptions::MSVC2015)) { - if (Opts.CPlusPlus2b) + if (Opts.CPlusPlus23) + // TODO update to the proper value. Builder.defineMacro("_MSVC_LANG", "202004L"); else if (Opts.CPlusPlus20) Builder.defineMacro("_MSVC_LANG", "202002L"); diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -1395,8 +1395,9 @@ const Arg *Std = Args.getLastArg(options::OPT_std_EQ); ModulesModeCXX20 = !Args.hasArg(options::OPT_fmodules) && Std && - (Std->containsValue("c++20") || Std->containsValue("c++2b") || - Std->containsValue("c++2a") || Std->containsValue("c++latest")); + (Std->containsValue("c++20") || Std->containsValue("c++2a") || + Std->containsValue("c++23") || Std->containsValue("c++2b") || + Std->containsValue("c++latest")); // Process -fmodule-header{=} flags. if (Arg *A = Args.getLastArg(options::OPT_fmodule_header_EQ, diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp --- a/clang/lib/Driver/ToolChains/Clang.cpp +++ b/clang/lib/Driver/ToolChains/Clang.cpp @@ -3673,7 +3673,8 @@ bool HaveStdCXXModules = IsCXX && Std && (Std->containsValue("c++2a") || Std->containsValue("c++20") || - Std->containsValue("c++2b") || Std->containsValue("c++latest")); + Std->containsValue("c++2b") || Std->containsValue("c++23") || + Std->containsValue("c++latest")); bool HaveModules = HaveStdCXXModules; // -fmodules enables the use of precompiled modules (off by default). @@ -6637,7 +6638,8 @@ .Case("c++14", "-std=c++14") .Case("c++17", "-std=c++17") .Case("c++20", "-std=c++20") - .Case("c++latest", "-std=c++2b") + // TODO add c++23 when MSVC supports it. + .Case("c++latest", "-std=c++23") .Default(""); if (LanguageStandard.empty()) D.Diag(clang::diag::warn_drv_unused_argument) diff --git a/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp --- a/clang/lib/Frontend/InitPreprocessor.cpp +++ b/clang/lib/Frontend/InitPreprocessor.cpp @@ -452,7 +452,7 @@ } else { // -- __cplusplus // FIXME: Use correct value for C++23. - if (LangOpts.CPlusPlus2b) + if (LangOpts.CPlusPlus23) Builder.defineMacro("__cplusplus", "202101L"); // [C++20] The integer literal 202002L. else if (LangOpts.CPlusPlus20) @@ -606,7 +606,7 @@ Builder.defineMacro("__cpp_unicode_literals", "200710L"); Builder.defineMacro("__cpp_user_defined_literals", "200809L"); Builder.defineMacro("__cpp_lambdas", "200907L"); - Builder.defineMacro("__cpp_constexpr", LangOpts.CPlusPlus2b ? "202211L" + Builder.defineMacro("__cpp_constexpr", LangOpts.CPlusPlus23 ? "202211L" : LangOpts.CPlusPlus20 ? "201907L" : LangOpts.CPlusPlus17 ? "201603L" : LangOpts.CPlusPlus14 ? "201304L" @@ -690,15 +690,15 @@ //Builder.defineMacro("__cpp_modules", "201907L"); Builder.defineMacro("__cpp_using_enum", "201907L"); } - // C++2b features. - if (LangOpts.CPlusPlus2b) { + // C++23 features. + if (LangOpts.CPlusPlus23) { Builder.defineMacro("__cpp_implicit_move", "202011L"); Builder.defineMacro("__cpp_size_t_suffix", "202011L"); Builder.defineMacro("__cpp_if_consteval", "202106L"); Builder.defineMacro("__cpp_multidimensional_subscript", "202211L"); } - // We provide those C++2b features as extensions in earlier language modes, so + // We provide those C++23 features as extensions in earlier language modes, so // we also define their feature test macros. if (LangOpts.CPlusPlus11) Builder.defineMacro("__cpp_static_call_operator", "202207L"); diff --git a/clang/lib/Headers/stdatomic.h b/clang/lib/Headers/stdatomic.h --- a/clang/lib/Headers/stdatomic.h +++ b/clang/lib/Headers/stdatomic.h @@ -49,7 +49,7 @@ in C2x mode; switch to the correct values once they've been published. */ #if (defined(__STDC_VERSION__) && __STDC_VERSION__ < 202000L) || \ defined(__cplusplus) -/* ATOMIC_VAR_INIT was removed in C2x, but still remains in C++2b. */ +/* ATOMIC_VAR_INIT was removed in C2x, but still remains in C++23. */ #define ATOMIC_VAR_INIT(value) (value) #endif diff --git a/clang/lib/Lex/Lexer.cpp b/clang/lib/Lex/Lexer.cpp --- a/clang/lib/Lex/Lexer.cpp +++ b/clang/lib/Lex/Lexer.cpp @@ -3348,8 +3348,8 @@ } if (Delimited && PP) { - Diag(SlashLoc, PP->getLangOpts().CPlusPlus2b - ? diag::warn_cxx2b_delimited_escape_sequence + Diag(SlashLoc, PP->getLangOpts().CPlusPlus23 + ? diag::warn_cxx23_delimited_escape_sequence : diag::ext_delimited_escape_sequence) << /*delimited*/ 0 << (PP->getLangOpts().CPlusPlus ? 1 : 0); } @@ -3436,8 +3436,8 @@ } if (Diagnose && Match) - Diag(SlashLoc, PP->getLangOpts().CPlusPlus2b - ? diag::warn_cxx2b_delimited_escape_sequence + Diag(SlashLoc, PP->getLangOpts().CPlusPlus23 + ? diag::warn_cxx23_delimited_escape_sequence : diag::ext_delimited_escape_sequence) << /*named*/ 1 << (PP->getLangOpts().CPlusPlus ? 1 : 0); diff --git a/clang/lib/Lex/LiteralSupport.cpp b/clang/lib/Lex/LiteralSupport.cpp --- a/clang/lib/Lex/LiteralSupport.cpp +++ b/clang/lib/Lex/LiteralSupport.cpp @@ -312,7 +312,7 @@ << tok::r_brace; else if (!HadError) { Diag(Diags, Features, Loc, ThisTokBegin, EscapeBegin, ThisTokBuf, - Features.CPlusPlus2b ? diag::warn_cxx2b_delimited_escape_sequence + Features.CPlusPlus23 ? diag::warn_cxx23_delimited_escape_sequence : diag::ext_delimited_escape_sequence) << /*delimited*/ 0 << (Features.CPlusPlus ? 1 : 0); } @@ -641,7 +641,7 @@ if ((IsDelimitedEscapeSequence || IsNamedEscapeSequence) && Diags) Diag(Diags, Features, Loc, ThisTokBegin, UcnBegin, ThisTokBuf, - Features.CPlusPlus2b ? diag::warn_cxx2b_delimited_escape_sequence + Features.CPlusPlus23 ? diag::warn_cxx23_delimited_escape_sequence : diag::ext_delimited_escape_sequence) << (IsNamedEscapeSequence ? 1 : 0) << (Features.CPlusPlus ? 1 : 0); diff --git a/clang/lib/Lex/PPDirectives.cpp b/clang/lib/Lex/PPDirectives.cpp --- a/clang/lib/Lex/PPDirectives.cpp +++ b/clang/lib/Lex/PPDirectives.cpp @@ -434,7 +434,7 @@ std::vector Candidates = { "if", "ifdef", "ifndef", "elif", "else", "endif" }; - if (LangOpts.C2x || LangOpts.CPlusPlus2b) + if (LangOpts.C2x || LangOpts.CPlusPlus23) Candidates.insert(Candidates.end(), {"elifdef", "elifndef"}); if (std::optional Sugg = findSimilarStr(Directive, Candidates)) { @@ -745,12 +745,12 @@ if (!CondInfo.WasSkipping) SkippingRangeState.endLexPass(Hashptr); - // Warn if using `#elifdef` & `#elifndef` in not C2x & C++2b mode even + // Warn if using `#elifdef` & `#elifndef` in not C2x & C++23 mode even // if this branch is in a skipping block. unsigned DiagID; if (LangOpts.CPlusPlus) - DiagID = LangOpts.CPlusPlus2b ? diag::warn_cxx2b_compat_pp_directive - : diag::ext_cxx2b_pp_directive; + DiagID = LangOpts.CPlusPlus23 ? diag::warn_cxx23_compat_pp_directive + : diag::ext_cxx23_pp_directive; else DiagID = LangOpts.C2x ? diag::warn_c2x_compat_pp_directive : diag::ext_c2x_pp_directive; @@ -1256,10 +1256,10 @@ case tok::pp_warning: if (LangOpts.CPlusPlus) - Diag(Result, LangOpts.CPlusPlus2b - ? diag::warn_cxx2b_compat_warning_directive + Diag(Result, LangOpts.CPlusPlus23 + ? diag::warn_cxx23_compat_warning_directive : diag::ext_pp_warning_directive) - << /*C++2b*/ 1; + << /*C++23*/ 1; else Diag(Result, LangOpts.C2x ? diag::warn_c2x_compat_warning_directive : diag::ext_pp_warning_directive) @@ -3423,14 +3423,14 @@ : PED_Elifndef; ++NumElse; - // Warn if using `#elifdef` & `#elifndef` in not C2x & C++2b mode. + // Warn if using `#elifdef` & `#elifndef` in not C2x & C++23 mode. switch (DirKind) { case PED_Elifdef: case PED_Elifndef: unsigned DiagID; if (LangOpts.CPlusPlus) - DiagID = LangOpts.CPlusPlus2b ? diag::warn_cxx2b_compat_pp_directive - : diag::ext_cxx2b_pp_directive; + DiagID = LangOpts.CPlusPlus23 ? diag::warn_cxx23_compat_pp_directive + : diag::ext_cxx23_pp_directive; else DiagID = LangOpts.C2x ? diag::warn_c2x_compat_pp_directive : diag::ext_c2x_pp_directive; diff --git a/clang/lib/Lex/PPExpressions.cpp b/clang/lib/Lex/PPExpressions.cpp --- a/clang/lib/Lex/PPExpressions.cpp +++ b/clang/lib/Lex/PPExpressions.cpp @@ -323,13 +323,13 @@ PP.Diag(PeekTok, diag::ext_c99_longlong); } - // 'z/uz' literals are a C++2b feature. + // 'z/uz' literals are a C++23 feature. if (Literal.isSizeT) PP.Diag(PeekTok, PP.getLangOpts().CPlusPlus - ? PP.getLangOpts().CPlusPlus2b + ? PP.getLangOpts().CPlusPlus23 ? diag::warn_cxx20_compat_size_t_suffix - : diag::ext_cxx2b_size_t_suffix - : diag::err_cxx2b_size_t_suffix); + : diag::ext_cxx23_size_t_suffix + : diag::err_cxx23_size_t_suffix); // 'wb/uwb' literals are a C2x feature. We explicitly do not support the // suffix in C++ as an extension because a library-based UDL that resolves diff --git a/clang/lib/Parse/ParseDeclCXX.cpp b/clang/lib/Parse/ParseDeclCXX.cpp --- a/clang/lib/Parse/ParseDeclCXX.cpp +++ b/clang/lib/Parse/ParseDeclCXX.cpp @@ -1076,7 +1076,7 @@ // Check for C++1y 'decltype(auto)'. if (Tok.is(tok::kw_auto) && NextToken().is(tok::r_paren)) { // the typename-specifier in a function-style cast expression may - // be 'auto' since C++2b. + // be 'auto' since C++23. Diag(Tok.getLocation(), getLangOpts().CPlusPlus14 ? diag::warn_cxx11_compat_decltype_auto_type_specifier diff --git a/clang/lib/Parse/ParseExpr.cpp b/clang/lib/Parse/ParseExpr.cpp --- a/clang/lib/Parse/ParseExpr.cpp +++ b/clang/lib/Parse/ParseExpr.cpp @@ -1871,7 +1871,7 @@ /// primary-expression /// postfix-expression '[' expression ']' /// postfix-expression '[' braced-init-list ']' -/// postfix-expression '[' expression-list [opt] ']' [C++2b 12.4.5] +/// postfix-expression '[' expression-list [opt] ']' [C++23 12.4.5] /// postfix-expression '(' argument-expression-list[opt] ')' /// postfix-expression '.' identifier /// postfix-expression '->' identifier @@ -1946,10 +1946,10 @@ // We try to parse a list of indexes in all language mode first // and, in we find 0 or one index, we try to parse an OpenMP array - // section. This allow us to support C++2b multi dimensional subscript and + // section. This allow us to support C++23 multi dimensional subscript and // OpenMp sections in the same language mode. if (!getLangOpts().OpenMP || Tok.isNot(tok::colon)) { - if (!getLangOpts().CPlusPlus2b) { + if (!getLangOpts().CPlusPlus23) { ExprResult Idx; if (getLangOpts().CPlusPlus11 && Tok.is(tok::l_brace)) { Diag(Tok, diag::warn_cxx98_compat_generalized_initializer_lists); diff --git a/clang/lib/Parse/ParseExprCXX.cpp b/clang/lib/Parse/ParseExprCXX.cpp --- a/clang/lib/Parse/ParseExprCXX.cpp +++ b/clang/lib/Parse/ParseExprCXX.cpp @@ -725,7 +725,7 @@ /// '&' identifier initializer /// /// lambda-declarator: -/// lambda-specifiers [C++2b] +/// lambda-specifiers [C++23] /// '(' parameter-declaration-clause ')' lambda-specifiers /// requires-clause[opt] /// @@ -1205,7 +1205,7 @@ static void addStaticToLambdaDeclSpecifier(Parser &P, SourceLocation StaticLoc, DeclSpec &DS) { if (StaticLoc.isValid()) { - P.Diag(StaticLoc, !P.getLangOpts().CPlusPlus2b + P.Diag(StaticLoc, !P.getLangOpts().CPlusPlus23 ? diag::err_static_lambda : diag::warn_cxx20_compat_static_lambda); const char *PrevSpec = nullptr; @@ -1362,7 +1362,7 @@ // or operator template declaration. We accept this as a conforming extension // in all language modes that support lambdas. if (isCXX11AttributeSpecifier()) { - Diag(Tok, getLangOpts().CPlusPlus2b + Diag(Tok, getLangOpts().CPlusPlus23 ? diag::warn_cxx20_compat_decl_attrs_on_lambda : diag::ext_decl_attrs_on_lambda); MaybeParseCXX11Attributes(D); @@ -1501,7 +1501,7 @@ tok::kw_requires, tok::kw_noexcept) || (Tok.is(tok::l_square) && NextToken().is(tok::l_square)); - if (HasSpecifiers && !HasParentheses && !getLangOpts().CPlusPlus2b) { + if (HasSpecifiers && !HasParentheses && !getLangOpts().CPlusPlus23) { // It's common to forget that one needs '()' before 'mutable', an // attribute specifier, the result type, or the requires clause. Deal with // this. @@ -1996,7 +1996,7 @@ if (!DG) return DG; - Diag(DeclStart, !getLangOpts().CPlusPlus2b + Diag(DeclStart, !getLangOpts().CPlusPlus23 ? diag::ext_alias_in_init_statement : diag::warn_cxx20_alias_in_init_statement) << SourceRange(DeclStart, DeclEnd); diff --git a/clang/lib/Parse/ParseStmt.cpp b/clang/lib/Parse/ParseStmt.cpp --- a/clang/lib/Parse/ParseStmt.cpp +++ b/clang/lib/Parse/ParseStmt.cpp @@ -1053,7 +1053,7 @@ void Parser::DiagnoseLabelAtEndOfCompoundStatement() { if (getLangOpts().CPlusPlus) { - Diag(Tok, getLangOpts().CPlusPlus2b + Diag(Tok, getLangOpts().CPlusPlus23 ? diag::warn_cxx20_compat_label_end_of_compound_statement : diag::ext_cxx_label_end_of_compound_statement); } else { @@ -1457,7 +1457,7 @@ } if (Tok.is(tok::kw_consteval)) { - Diag(Tok, getLangOpts().CPlusPlus2b ? diag::warn_cxx20_compat_consteval_if + Diag(Tok, getLangOpts().CPlusPlus23 ? diag::warn_cxx20_compat_consteval_if : diag::ext_consteval_if); IsConsteval = true; ConstevalLoc = ConsumeToken(); @@ -1929,7 +1929,7 @@ /// [C++] for-init-statement: /// [C++] expression-statement /// [C++] simple-declaration -/// [C++2b] alias-declaration +/// [C++23] alias-declaration /// /// [C++0x] for-range-declaration: /// [C++0x] attribute-specifier-seq[opt] type-specifier-seq declarator diff --git a/clang/lib/Sema/Sema.cpp b/clang/lib/Sema/Sema.cpp --- a/clang/lib/Sema/Sema.cpp +++ b/clang/lib/Sema/Sema.cpp @@ -2169,7 +2169,7 @@ new (S.Context) DeclRefExpr(S.Context, VD, false, T, VK_LValue, Loc); ExprResult Result; auto IE = InitializedEntity::InitializeBlock(Loc, T); - if (S.getLangOpts().CPlusPlus2b) { + if (S.getLangOpts().CPlusPlus23) { auto *E = ImplicitCastExpr::Create(S.Context, T, CK_NoOp, VarRef, nullptr, VK_XValue, FPOptionsOverride()); Result = S.PerformCopyInitialization(IE, SourceLocation(), E); diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp --- a/clang/lib/Sema/SemaDeclCXX.cpp +++ b/clang/lib/Sema/SemaDeclCXX.cpp @@ -762,7 +762,7 @@ // C++20 [dcl.dcl]/8: // If decl-specifier-seq contains any decl-specifier other than static, // thread_local, auto, or cv-qualifiers, the program is ill-formed. - // C++2b [dcl.pre]/6: + // C++23 [dcl.pre]/6: // Each decl-specifier in the decl-specifier-seq shall be static, // thread_local, auto (9.2.9.6 [dcl.spec.auto]), or a cv-qualifier. auto &DS = D.getDeclSpec(); @@ -1928,16 +1928,16 @@ if (VD->isStaticLocal()) { if (Kind == Sema::CheckConstexprKind::Diagnose) { SemaRef.Diag(VD->getLocation(), - SemaRef.getLangOpts().CPlusPlus2b + SemaRef.getLangOpts().CPlusPlus23 ? diag::warn_cxx20_compat_constexpr_var : diag::ext_constexpr_static_var) << isa(Dcl) << (VD->getTLSKind() == VarDecl::TLS_Dynamic); - } else if (!SemaRef.getLangOpts().CPlusPlus2b) { + } else if (!SemaRef.getLangOpts().CPlusPlus23) { return false; } } - if (SemaRef.LangOpts.CPlusPlus2b) { + if (SemaRef.LangOpts.CPlusPlus23) { CheckLiteralType(SemaRef, Kind, VD->getLocation(), VD->getType(), diag::warn_cxx20_compat_constexpr_var, isa(Dcl), @@ -2276,15 +2276,15 @@ if (Kind == Sema::CheckConstexprKind::CheckValid) { // If this is only valid as an extension, report that we don't satisfy the // constraints of the current language. - if ((Cxx2bLoc.isValid() && !SemaRef.getLangOpts().CPlusPlus2b) || + if ((Cxx2bLoc.isValid() && !SemaRef.getLangOpts().CPlusPlus23) || (Cxx2aLoc.isValid() && !SemaRef.getLangOpts().CPlusPlus20) || (Cxx1yLoc.isValid() && !SemaRef.getLangOpts().CPlusPlus17)) return false; } else if (Cxx2bLoc.isValid()) { SemaRef.Diag(Cxx2bLoc, - SemaRef.getLangOpts().CPlusPlus2b + SemaRef.getLangOpts().CPlusPlus23 ? diag::warn_cxx20_compat_constexpr_body_invalid_stmt - : diag::ext_constexpr_body_invalid_stmt_cxx2b) + : diag::ext_constexpr_body_invalid_stmt_cxx23) << isa(Dcl); } else if (Cxx2aLoc.isValid()) { SemaRef.Diag(Cxx2aLoc, @@ -15976,7 +15976,7 @@ if (MethodDecl->isStatic()) { if (Op == OO_Call || Op == OO_Subscript) Diag(FnDecl->getLocation(), - (LangOpts.CPlusPlus2b + (LangOpts.CPlusPlus23 ? diag::warn_cxx20_compat_operator_overload_static : diag::ext_operator_overload_static)) << FnDecl; @@ -16017,7 +16017,7 @@ } if (FirstDefaultedParam) { if (Op == OO_Subscript) { - Diag(FnDecl->getLocation(), LangOpts.CPlusPlus2b + Diag(FnDecl->getLocation(), LangOpts.CPlusPlus23 ? diag::ext_subscript_overload : diag::error_subscript_overload) << FnDecl->getDeclName() << 1 @@ -16068,7 +16068,7 @@ } if (Op == OO_Subscript && NumParams != 2) { - Diag(FnDecl->getLocation(), LangOpts.CPlusPlus2b + Diag(FnDecl->getLocation(), LangOpts.CPlusPlus23 ? diag::ext_subscript_overload : diag::error_subscript_overload) << FnDecl->getDeclName() << (NumParams == 1 ? 0 : 2); diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -3957,13 +3957,13 @@ } else { QualType Ty; - // 'z/uz' literals are a C++2b feature. + // 'z/uz' literals are a C++23 feature. if (Literal.isSizeT) Diag(Tok.getLocation(), getLangOpts().CPlusPlus - ? getLangOpts().CPlusPlus2b + ? getLangOpts().CPlusPlus23 ? diag::warn_cxx20_compat_size_t_suffix - : diag::ext_cxx2b_size_t_suffix - : diag::err_cxx2b_size_t_suffix); + : diag::ext_cxx23_size_t_suffix + : diag::err_cxx23_size_t_suffix); // 'wb/uwb' literals are a C2x feature. We support _BitInt as a type in C++, // but we do not currently support the suffix in C++ mode because it's not @@ -4043,7 +4043,7 @@ Ty = Context.getBitIntType(Literal.isUnsigned, Width); } - // Check C++2b size_t literals. + // Check C++23 size_t literals. if (Literal.isSizeT) { assert(!Literal.MicrosoftInteger && "size_t literals can't be Microsoft literals"); diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp --- a/clang/lib/Sema/SemaExprCXX.cpp +++ b/clang/lib/Sema/SemaExprCXX.cpp @@ -1467,10 +1467,10 @@ : InitializationKind::CreateValue(TyBeginLoc, LParenOrBraceLoc, RParenOrBraceLoc); - // C++1z [expr.type.conv]p1: + // C++17 [expr.type.conv]p1: // If the type is a placeholder for a deduced class type, [...perform class // template argument deduction...] - // C++2b: + // C++23: // Otherwise, if the type contains a placeholder type, it is replaced by the // type determined by placeholder type deduction. DeducedType *Deduced = Ty->getContainedDeducedType(); @@ -1497,7 +1497,7 @@ diag::err_auto_expr_init_multiple_expressions) << Ty << FullRange); } - if (getLangOpts().CPlusPlus2b) { + if (getLangOpts().CPlusPlus23) { if (Ty->getAs()) Diag(TyBeginLoc, diag::warn_cxx20_compat_auto_expr) << FullRange; } @@ -4022,7 +4022,7 @@ // The value of a condition that is an expression is the value of the // expression, implicitly converted to bool. // - // C++2b 8.5.2p2 + // C++23 8.5.2p2 // If the if statement is of the form if constexpr, the value of the condition // is contextually converted to bool and the converted expression shall be // a constant expression. diff --git a/clang/lib/Sema/SemaModule.cpp b/clang/lib/Sema/SemaModule.cpp --- a/clang/lib/Sema/SemaModule.cpp +++ b/clang/lib/Sema/SemaModule.cpp @@ -255,7 +255,7 @@ } } - // C++2b [module.unit]p1: ... The identifiers module and import shall not + // C++23 [module.unit]p1: ... The identifiers module and import shall not // appear as identifiers in a module-name or module-partition. All // module-names either beginning with an identifier consisting of std // followed by zero or more digits or containing a reserved identifier diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp --- a/clang/lib/Sema/SemaOverload.cpp +++ b/clang/lib/Sema/SemaOverload.cpp @@ -9929,7 +9929,7 @@ } } - // C++ [over.match.best]p1: (Changed in C++2b) + // C++ [over.match.best]p1: (Changed in C++23) // // -- if F is a static member function, ICS1(F) is defined such // that ICS1(F) is neither better nor worse than ICS1(G) for @@ -15099,7 +15099,7 @@ bool IsError = false; // Initialize the implicit object parameter if needed. - // Since C++2b, this could also be a call to a static call operator + // Since C++23, this could also be a call to a static call operator // which we emit as a regular CallExpr. if (Method->isInstance()) { ExprResult ObjRes = PerformObjectArgumentInitialization( diff --git a/clang/lib/Sema/SemaStmt.cpp b/clang/lib/Sema/SemaStmt.cpp --- a/clang/lib/Sema/SemaStmt.cpp +++ b/clang/lib/Sema/SemaStmt.cpp @@ -3364,7 +3364,7 @@ /// might be modified by the implementation. /// /// \param Mode Overrides detection of current language mode -/// and uses the rules for C++2b. +/// and uses the rules for C++23. /// /// \returns An aggregate which contains the Candidate and isMoveEligible /// and isCopyElidable methods. If Candidate is non-null, it means @@ -3385,7 +3385,7 @@ if (Res.Candidate && !E->isXValue() && (Mode == SimplerImplicitMoveMode::ForceOn || (Mode != SimplerImplicitMoveMode::ForceOff && - getLangOpts().CPlusPlus2b))) { + getLangOpts().CPlusPlus23))) { E = ImplicitCastExpr::Create(Context, VD->getType().getNonReferenceType(), CK_NoOp, E, nullptr, VK_XValue, FPOptionsOverride()); @@ -3529,7 +3529,7 @@ const InitializedEntity &Entity, const NamedReturnInfo &NRInfo, Expr *Value, bool SupressSimplerImplicitMoves) { if (getLangOpts().CPlusPlus && - (!getLangOpts().CPlusPlus2b || SupressSimplerImplicitMoves) && + (!getLangOpts().CPlusPlus23 || SupressSimplerImplicitMoves) && NRInfo.isMoveEligible()) { ImplicitCastExpr AsRvalue(ImplicitCastExpr::OnStack, Value->getType(), CK_NoOp, Value, VK_XValue, FPOptionsOverride()); @@ -3902,7 +3902,7 @@ static bool CheckSimplerImplicitMovesMSVCWorkaround(const Sema &S, const Expr *E) { - if (!E || !S.getLangOpts().CPlusPlus2b || !S.getLangOpts().MSVCCompat) + if (!E || !S.getLangOpts().CPlusPlus23 || !S.getLangOpts().MSVCCompat) return false; const Decl *D = E->getReferencedDeclOfCallee(); if (!D || !S.SourceMgr.isInSystemHeader(D->getLocation())) diff --git a/clang/lib/Sema/SemaType.cpp b/clang/lib/Sema/SemaType.cpp --- a/clang/lib/Sema/SemaType.cpp +++ b/clang/lib/Sema/SemaType.cpp @@ -3645,7 +3645,7 @@ case DeclaratorContext::FunctionalCast: if (isa(Deduced)) break; - if (SemaRef.getLangOpts().CPlusPlus2b && IsCXXAutoType && + if (SemaRef.getLangOpts().CPlusPlus23 && IsCXXAutoType && !Auto->isDecltypeAuto()) break; // auto(x) [[fallthrough]]; diff --git a/clang/test/AST/Interp/if.cpp b/clang/test/AST/Interp/if.cpp --- a/clang/test/AST/Interp/if.cpp +++ b/clang/test/AST/Interp/if.cpp @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -std=c++2b -fsyntax-only -fexperimental-new-constant-interpreter %s -verify -// RUN: %clang_cc1 -std=c++2b -fsyntax-only %s -verify=ref +// RUN: %clang_cc1 -std=c++23 -fsyntax-only -fexperimental-new-constant-interpreter %s -verify +// RUN: %clang_cc1 -std=c++23 -fsyntax-only %s -verify=ref // expected-no-diagnostics // ref-no-diagnostics diff --git a/clang/test/AST/ast-dump-if-json.cpp b/clang/test/AST/ast-dump-if-json.cpp --- a/clang/test/AST/ast-dump-if-json.cpp +++ b/clang/test/AST/ast-dump-if-json.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-pc-linux -std=c++2b -ast-dump=json %s | FileCheck %s +// RUN: %clang_cc1 -triple x86_64-pc-linux -std=c++23 -ast-dump=json %s | FileCheck %s void func(int val) { if (val) diff --git a/clang/test/AST/ast-dump-stmt.cpp b/clang/test/AST/ast-dump-stmt.cpp --- a/clang/test/AST/ast-dump-stmt.cpp +++ b/clang/test/AST/ast-dump-stmt.cpp @@ -1,10 +1,10 @@ // Test without serialization: -// RUN: %clang_cc1 -std=c++2b -triple x86_64-linux-gnu -fcxx-exceptions -ast-dump %s \ +// RUN: %clang_cc1 -std=c++23 -triple x86_64-linux-gnu -fcxx-exceptions -ast-dump %s \ // RUN: | FileCheck -strict-whitespace %s // // Test with serialization: -// RUN: %clang_cc1 -std=c++2b -triple x86_64-linux-gnu -fcxx-exceptions -emit-pch -o %t %s -// RUN: %clang_cc1 -x c++ -std=c++2b -triple x86_64-linux-gnu -fcxx-exceptions -include-pch %t -ast-dump-all /dev/null \ +// RUN: %clang_cc1 -std=c++23 -triple x86_64-linux-gnu -fcxx-exceptions -emit-pch -o %t %s +// RUN: %clang_cc1 -x c++ -std=c++23 -triple x86_64-linux-gnu -fcxx-exceptions -include-pch %t -ast-dump-all /dev/null \ // RUN: | sed -e "s/ //" -e "s/ imported//" \ // RUN: | FileCheck -strict-whitespace %s diff --git a/clang/test/CXX/class/class.init/class.copy.elision/p3.cpp b/clang/test/CXX/class/class.init/class.copy.elision/p3.cpp --- a/clang/test/CXX/class/class.init/class.copy.elision/p3.cpp +++ b/clang/test/CXX/class/class.init/class.copy.elision/p3.cpp @@ -1,6 +1,6 @@ -// RUN: %clang_cc1 -std=c++2b -fsyntax-only -fcxx-exceptions -verify=expected,cxx11_2b,cxx2b %s -// RUN: %clang_cc1 -std=c++20 -fsyntax-only -fcxx-exceptions -verify=expected,cxx98_20,cxx11_2b,cxx11_20 %s -// RUN: %clang_cc1 -std=c++11 -fsyntax-only -fcxx-exceptions -verify=expected,cxx98_20,cxx11_2b,cxx11_20 %s +// RUN: %clang_cc1 -std=c++23 -fsyntax-only -fcxx-exceptions -verify=expected,cxx11_23,cxx23 %s +// RUN: %clang_cc1 -std=c++20 -fsyntax-only -fcxx-exceptions -verify=expected,cxx98_20,cxx11_23,cxx11_20 %s +// RUN: %clang_cc1 -std=c++11 -fsyntax-only -fcxx-exceptions -verify=expected,cxx98_20,cxx11_23,cxx11_20 %s // RUN: %clang_cc1 -std=c++98 -fsyntax-only -fcxx-exceptions -Wno-c++11-extensions -verify=expected,cxx98_20,cxx98 %s namespace test_delete_function { @@ -98,7 +98,7 @@ A1(const A1 &); A1(A1 &&) = delete; // expected-note@-1 2{{'A1' has been explicitly marked deleted here}} - // cxx11_2b-note@-2 3{{'A1' has been explicitly marked deleted here}} + // cxx11_23-note@-2 3{{'A1' has been explicitly marked deleted here}} }; void test1() { try { @@ -208,7 +208,7 @@ struct NeedValue { NeedValue(A1); // cxx98-note 2 {{passing argument to parameter here}} NeedValue(A2); - NeedValue(B1); // cxx11_2b-note 2 {{passing argument to parameter here}} + NeedValue(B1); // cxx11_23-note 2 {{passing argument to parameter here}} NeedValue(B2); }; @@ -267,14 +267,14 @@ struct B1 { B1(); B1(const B1 &); - B1(B1 &&) = delete; // cxx11_2b-note 3 {{'B1' has been explicitly marked deleted here}} + B1(B1 &&) = delete; // cxx11_23-note 3 {{'B1' has been explicitly marked deleted here}} // cxx98-note@-1 {{'B1' has been explicitly marked deleted here}} }; NeedValue test_3_1() { // not rvalue reference // same type B1 b; - return b; // cxx11_2b-error {{call to deleted constructor of 'B1'}} + return b; // cxx11_23-error {{call to deleted constructor of 'B1'}} } class DerivedB1 : public B1 {}; B1 test_3_2() { @@ -287,7 +287,7 @@ // not rvalue reference // not same type DerivedB1 b; - return b; // cxx11_2b-error {{call to deleted constructor of 'B1'}} + return b; // cxx11_23-error {{call to deleted constructor of 'B1'}} } struct B2 { @@ -295,14 +295,14 @@ B2(const B2 &); private: - B2(B2 &&); // cxx11_2b-note 3 {{declared private here}} + B2(B2 &&); // cxx11_23-note 3 {{declared private here}} // cxx98-note@-1 {{declared private here}} }; NeedValue test_4_1() { // not rvalue reference // same type B2 b; - return b; // cxx11_2b-error {{calling a private constructor of class 'test_ctor_param_rvalue_ref::B2'}} + return b; // cxx11_23-error {{calling a private constructor of class 'test_ctor_param_rvalue_ref::B2'}} } class DerivedB2 : public B2 {}; B2 test_4_2() { @@ -315,7 +315,7 @@ // not rvalue reference // not same type DerivedB2 b; - return b; // cxx11_2b-error {{calling a private constructor of class 'test_ctor_param_rvalue_ref::B2'}} + return b; // cxx11_23-error {{calling a private constructor of class 'test_ctor_param_rvalue_ref::B2'}} } } // namespace test_ctor_param_rvalue_ref @@ -323,7 +323,7 @@ struct Target {}; // expected-note@-1 {{candidate constructor (the implicit copy constructor) not viable}} -// cxx11_2b-note@-2 {{candidate constructor (the implicit move constructor) not viable}} +// cxx11_23-note@-2 {{candidate constructor (the implicit move constructor) not viable}} struct CopyOnly { CopyOnly(CopyOnly &&) = delete; // expected-note {{has been explicitly marked deleted here}} @@ -333,7 +333,7 @@ }; struct MoveOnly { - MoveOnly(MoveOnly &&); // cxx11_2b-note {{copy constructor is implicitly deleted because}} + MoveOnly(MoveOnly &&); // cxx11_23-note {{copy constructor is implicitly deleted because}} operator Target() &&; // expected-note {{candidate function not viable}} }; @@ -352,7 +352,7 @@ MoveOnly t3() { MoveOnly& r = moveonly; - return r; // cxx11_2b-error {{call to implicitly-deleted copy constructor}} + return r; // cxx11_23-error {{call to implicitly-deleted copy constructor}} } MoveOnly t4() { @@ -437,11 +437,11 @@ struct NonConstCopyOnly { NonConstCopyOnly(); NonConstCopyOnly(NonConstCopyOnly &); - NonConstCopyOnly(const NonConstCopyOnly &) = delete; // cxx11_2b-note {{marked deleted here}} + NonConstCopyOnly(const NonConstCopyOnly &) = delete; // cxx11_23-note {{marked deleted here}} }; NonConstCopyOnly t2() { NonConstCopyOnly x; - return x; // cxx11_2b-error {{call to deleted constructor}} + return x; // cxx11_23-error {{call to deleted constructor}} } } // namespace test_constandnonconstcopy @@ -469,10 +469,10 @@ namespace test_simpler_implicit_move { struct CopyOnly { - CopyOnly(); // cxx2b-note {{candidate constructor not viable: requires 0 arguments, but 1 was provided}} - // cxx2b-note@-1 {{candidate constructor not viable: requires 0 arguments, but 1 was provided}} - CopyOnly(CopyOnly &); // cxx2b-note {{candidate constructor not viable: expects an lvalue for 1st argument}} - // cxx2b-note@-1 {{candidate constructor not viable: expects an lvalue for 1st argument}} + CopyOnly(); // cxx23-note {{candidate constructor not viable: requires 0 arguments, but 1 was provided}} + // cxx23-note@-1 {{candidate constructor not viable: requires 0 arguments, but 1 was provided}} + CopyOnly(CopyOnly &); // cxx23-note {{candidate constructor not viable: expects an lvalue for 1st argument}} + // cxx23-note@-1 {{candidate constructor not viable: expects an lvalue for 1st argument}} }; struct MoveOnly { MoveOnly(); @@ -490,7 +490,7 @@ if (b) { return w1; } else { - return w2; // cxx2b-error {{no matching constructor for initialization}} + return w2; // cxx23-error {{no matching constructor for initialization}} } } @@ -505,7 +505,7 @@ void test5() try { CopyOnly x; - throw x; // cxx2b-error {{no matching constructor for initialization}} + throw x; // cxx23-error {{no matching constructor for initialization}} } catch (...) { } diff --git a/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/dtor.cpp b/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/dtor.cpp --- a/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/dtor.cpp +++ b/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/dtor.cpp @@ -1,5 +1,5 @@ // RUN: %clang_cc1 -std=c++2a -verify=expected,cxx2a %s -// RUN: %clang_cc1 -std=c++2b -verify=expected %s +// RUN: %clang_cc1 -std=c++23 -verify=expected %s // p3: if the function is a constructor or destructor, its class shall not have // any virtual base classes; @@ -14,13 +14,13 @@ struct A { constexpr ~A() { return; - goto x; // cxx2a-warning {{use of this statement in a constexpr function is a C++2b extension}} + goto x; // cxx2a-warning {{use of this statement in a constexpr function is a C++23 extension}} x: ; } }; struct B { constexpr ~B() { - x:; // cxx2a-warning {{use of this statement in a constexpr function is a C++2b extension}} + x:; // cxx2a-warning {{use of this statement in a constexpr function is a C++23 extension}} } }; struct Nonlit { // cxx2a-note {{'Nonlit' is not literal because}} @@ -29,19 +29,19 @@ struct C { constexpr ~C() { return; - Nonlit nl; // cxx2a-error {{variable of non-literal type 'Nonlit' cannot be defined in a constexpr function before C++2b}} + Nonlit nl; // cxx2a-error {{variable of non-literal type 'Nonlit' cannot be defined in a constexpr function before C++23}} } }; struct D { constexpr ~D() { return; - static int a; // cxx2a-warning {{definition of a static variable in a constexpr function is a C++2b extension}} + static int a; // cxx2a-warning {{definition of a static variable in a constexpr function is a C++23 extension}} } }; struct E { constexpr ~E() { return; - thread_local int e; // cxx2a-warning {{definition of a thread_local variable in a constexpr function is a C++2b extension}} + thread_local int e; // cxx2a-warning {{definition of a thread_local variable in a constexpr function is a C++23 extension}} } }; struct F { diff --git a/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p3-2b.cpp b/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p3-2b.cpp --- a/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p3-2b.cpp +++ b/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p3-2b.cpp @@ -1,28 +1,28 @@ -// RUN: %clang_cc1 -verify -std=c++2b -Wpre-c++2b-compat %s +// RUN: %clang_cc1 -verify -std=c++23 -Wpre-c++23-compat %s constexpr int h(int n) { if (!n) return 0; - static const int m = n; // expected-warning {{definition of a static variable in a constexpr function is incompatible with C++ standards before C++2b}} + static const int m = n; // expected-warning {{definition of a static variable in a constexpr function is incompatible with C++ standards before C++23}} return m; } constexpr int i(int n) { if (!n) return 0; - thread_local const int m = n; // expected-warning {{definition of a thread_local variable in a constexpr function is incompatible with C++ standards before C++2b}} + thread_local const int m = n; // expected-warning {{definition of a thread_local variable in a constexpr function is incompatible with C++ standards before C++23}} return m; } constexpr int g() { // expected-error {{constexpr function never produces a constant expression}} goto test; // expected-note {{subexpression not valid in a constant expression}} \ - // expected-warning {{use of this statement in a constexpr function is incompatible with C++ standards before C++2b}} + // expected-warning {{use of this statement in a constexpr function is incompatible with C++ standards before C++23}} test: return 0; } constexpr void h() { -label:; // expected-warning {{use of this statement in a constexpr function is incompatible with C++ standards before C++2b}} +label:; // expected-warning {{use of this statement in a constexpr function is incompatible with C++ standards before C++23}} } struct NonLiteral { // expected-note 2 {{'NonLiteral' is not literal}} @@ -31,18 +31,18 @@ constexpr void non_literal() { // expected-error {{constexpr function never produces a constant expression}} NonLiteral n; // expected-note {{non-literal type 'NonLiteral' cannot be used in a constant expression}} \ - // expected-warning {{definition of a variable of non-literal type in a constexpr function is incompatible with C++ standards before C++2b}} + // expected-warning {{definition of a variable of non-literal type in a constexpr function is incompatible with C++ standards before C++23}} } constexpr void non_literal2(bool b) { if (!b) - NonLiteral n; // expected-warning {{definition of a variable of non-literal type in a constexpr function is incompatible with C++ standards before C++2b}} + NonLiteral n; // expected-warning {{definition of a variable of non-literal type in a constexpr function is incompatible with C++ standards before C++23}} } constexpr int c_thread_local(int n) { if (!n) return 0; - static _Thread_local int a; // expected-warning {{definition of a static variable in a constexpr function is incompatible with C++ standards before C++2b}} + static _Thread_local int a; // expected-warning {{definition of a static variable in a constexpr function is incompatible with C++ standards before C++23}} _Thread_local int b; // // expected-error {{'_Thread_local' variables must have global storage}} return 0; } @@ -50,7 +50,7 @@ constexpr int gnu_thread_local(int n) { if (!n) return 0; - static __thread int a; // expected-warning {{definition of a static variable in a constexpr function is incompatible with C++ standards before C++2b}} + static __thread int a; // expected-warning {{definition of a static variable in a constexpr function is incompatible with C++ standards before C++23}} __thread int b; // expected-error {{'__thread' variables must have global storage}} return 0; } diff --git a/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p3.cpp b/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p3.cpp --- a/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p3.cpp +++ b/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p3.cpp @@ -1,7 +1,7 @@ -// RUN: %clang_cc1 -fcxx-exceptions -verify=expected,beforecxx14,beforecxx20,beforecxx2b -std=c++11 %s -// RUN: %clang_cc1 -fcxx-exceptions -verify=expected,aftercxx14,beforecxx20,beforecxx2b -std=c++14 %s -// RUN: %clang_cc1 -fcxx-exceptions -verify=expected,aftercxx14,aftercxx20,beforecxx2b -std=c++20 %s -// RUN: %clang_cc1 -fcxx-exceptions -verify=expected,aftercxx14,aftercxx20 -std=c++2b %s +// RUN: %clang_cc1 -fcxx-exceptions -verify=expected,beforecxx14,beforecxx20,beforecxx23 -std=c++11 %s +// RUN: %clang_cc1 -fcxx-exceptions -verify=expected,aftercxx14,beforecxx20,beforecxx23 -std=c++14 %s +// RUN: %clang_cc1 -fcxx-exceptions -verify=expected,aftercxx14,aftercxx20,beforecxx23 -std=c++20 %s +// RUN: %clang_cc1 -fcxx-exceptions -verify=expected,aftercxx14,aftercxx20 -std=c++23 %s namespace N { typedef char C; @@ -124,12 +124,12 @@ constexpr int DisallowedStmtsCXX14_2() { return 0; // beforecxx14-note {{previous}} // - a goto statement - goto x; // beforecxx2b-warning {{use of this statement in a constexpr function is a C++2b extension}} + goto x; // beforecxx23-warning {{use of this statement in a constexpr function is a C++23 extension}} x:; return 0; // beforecxx14-warning {{multiple return}} } constexpr int DisallowedStmtsCXX14_2_1() { -merp: // beforecxx2b-warning {{use of this statement in a constexpr function is a C++2b extension}} +merp: // beforecxx23-warning {{use of this statement in a constexpr function is a C++23 extension}} return 0; } constexpr int DisallowedStmtsCXX14_3() { @@ -141,14 +141,14 @@ constexpr int DisallowedStmtsCXX14_4() { // - a definition of a variable of non-literal type return 0; - NonLiteral nl; // beforecxx2b-error {{variable of non-literal type 'NonLiteral' cannot be defined in a constexpr function before C++2b}} \ - // beforecxx2b-note@14 {{'NonLiteral' is not literal}} + NonLiteral nl; // beforecxx23-error {{variable of non-literal type 'NonLiteral' cannot be defined in a constexpr function before C++23}} \ + // beforecxx23-note@14 {{'NonLiteral' is not literal}} } constexpr int DisallowedStmtsCXX14_5() { return 0; // - a definition of a variable of static storage duration - static constexpr int n = 123; // beforecxx2b-warning {{definition of a static variable in a constexpr function is a C++2b extension}} \ + static constexpr int n = 123; // beforecxx23-warning {{definition of a static variable in a constexpr function is a C++23 extension}} \ // beforecxx14-warning {{variable declaration in a constexpr function is a C++14 extension}} } @@ -156,7 +156,7 @@ // - a definition of a variable of thread storage duration return 0; thread_local constexpr int n = 123; // beforecxx14-warning {{variable declaration in a constexpr function is a C++14 extension}} \ - // beforecxx2b-warning {{definition of a thread_local variable in a constexpr function is a C++2b extension}} + // beforecxx23-warning {{definition of a thread_local variable in a constexpr function is a C++23 extension}} } constexpr int DisallowedStmtsCXX14_7() { // - a definition of a variable for which no initialization is performed @@ -262,7 +262,7 @@ } constexpr int first(int n) { return 0; - static int value = n; // beforecxx2b-warning {{definition of a static variable in a constexpr function is a C++2b extension}} \ + static int value = n; // beforecxx23-warning {{definition of a static variable in a constexpr function is a C++23 extension}} \ // beforecxx14-warning {{variable declaration in a constexpr function is a C++14 extension}} } constexpr int uninit() { diff --git a/clang/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p7-cxx14.cpp b/clang/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p7-cxx14.cpp --- a/clang/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p7-cxx14.cpp +++ b/clang/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p7-cxx14.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -verify -std=c++2b -verify=expected,cxx2b %s +// RUN: %clang_cc1 -verify -std=c++23 -verify=expected,cxx23 %s // RUN: %clang_cc1 -verify -std=c++20 -verify=expected,cxx14_20 %s // RUN: %clang_cc1 -verify -std=c++14 -verify=expected,cxx14_20 %s @@ -30,7 +30,7 @@ auto x4a = (i); decltype(auto) x4d = (i); using Int = decltype(x4a); -using IntLRef = decltype(x4d); // cxx2b-note {{previous definition is here}} +using IntLRef = decltype(x4d); // cxx23-note {{previous definition is here}} auto x5a = f(); decltype(auto) x5d = f(); @@ -81,7 +81,7 @@ auto f3a(int n) { return (n); } decltype(auto) f3d(int n) { return (n); } // expected-warning {{reference to stack memory}} using Int = decltype(f3a(0)); -using IntLRef = decltype(f3d(0)); // cxx2b-error {{type alias redefinition with different types ('decltype(f3d(0))' (aka 'int &&') vs 'decltype(x4d)' (aka 'int &'))}} +using IntLRef = decltype(f3d(0)); // cxx23-error {{type alias redefinition with different types ('decltype(f3d(0))' (aka 'int &&') vs 'decltype(x4d)' (aka 'int &'))}} auto f4a(int n) { return f(); } decltype(auto) f4d(int n) { return f(); } diff --git a/clang/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.type.auto.deduct/p2.cpp b/clang/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.type.auto.deduct/p2.cpp --- a/clang/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.type.auto.deduct/p2.cpp +++ b/clang/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.type.auto.deduct/p2.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -std=c++2b -verify %s +// RUN: %clang_cc1 -std=c++23 -verify %s // p2.3 allows only T = auto in T(x). diff --git a/clang/test/CXX/drs/dr0xx.cpp b/clang/test/CXX/drs/dr0xx.cpp --- a/clang/test/CXX/drs/dr0xx.cpp +++ b/clang/test/CXX/drs/dr0xx.cpp @@ -3,7 +3,7 @@ // RUN: %clang_cc1 -std=c++14 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -triple %itanium_abi_triple // RUN: %clang_cc1 -std=c++17 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -triple %itanium_abi_triple // RUN: %clang_cc1 -std=c++20 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -triple %itanium_abi_triple -// RUN: %clang_cc1 -std=c++2b %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -triple %itanium_abi_triple +// RUN: %clang_cc1 -std=c++23 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -triple %itanium_abi_triple namespace dr1 { // dr1: no namespace X { extern "C" void dr1_f(int a = 1); } diff --git a/clang/test/CXX/drs/dr10xx.cpp b/clang/test/CXX/drs/dr10xx.cpp --- a/clang/test/CXX/drs/dr10xx.cpp +++ b/clang/test/CXX/drs/dr10xx.cpp @@ -3,7 +3,7 @@ // RUN: %clang_cc1 -std=c++14 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors // RUN: %clang_cc1 -std=c++17 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors // RUN: %clang_cc1 -std=c++20 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -// RUN: %clang_cc1 -std=c++2b %s -verify -fexceptions -fcxx-exceptions -pedantic-errors +// RUN: %clang_cc1 -std=c++23 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors namespace std { __extension__ typedef __SIZE_TYPE__ size_t; diff --git a/clang/test/CXX/drs/dr12xx.cpp b/clang/test/CXX/drs/dr12xx.cpp --- a/clang/test/CXX/drs/dr12xx.cpp +++ b/clang/test/CXX/drs/dr12xx.cpp @@ -3,7 +3,7 @@ // RUN: %clang_cc1 -std=c++14 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors // RUN: %clang_cc1 -std=c++17 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors // RUN: %clang_cc1 -std=c++20 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -// RUN: %clang_cc1 -std=c++2b %s -verify -fexceptions -fcxx-exceptions -pedantic-errors +// RUN: %clang_cc1 -std=c++23 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors // dr1200: na diff --git a/clang/test/CXX/drs/dr18xx.cpp b/clang/test/CXX/drs/dr18xx.cpp --- a/clang/test/CXX/drs/dr18xx.cpp +++ b/clang/test/CXX/drs/dr18xx.cpp @@ -3,7 +3,7 @@ // RUN: %clang_cc1 -std=c++14 -triple x86_64-unknown-unknown %s -verify -fexceptions -Wno-deprecated-builtins -fcxx-exceptions -pedantic-errors // RUN: %clang_cc1 -std=c++17 -triple x86_64-unknown-unknown %s -verify -fexceptions -Wno-deprecated-builtins -fcxx-exceptions -pedantic-errors // RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-unknown %s -verify -fexceptions -Wno-deprecated-builtins -fcxx-exceptions -pedantic-errors -// RUN: %clang_cc1 -std=c++2b -triple x86_64-unknown-unknown %s -verify -fexceptions -Wno-deprecated-builtins -fcxx-exceptions -pedantic-errors +// RUN: %clang_cc1 -std=c++23 -triple x86_64-unknown-unknown %s -verify -fexceptions -Wno-deprecated-builtins -fcxx-exceptions -pedantic-errors #if __cplusplus < 201103L // expected-error@+1 {{variadic macro}} diff --git a/clang/test/CXX/drs/dr1xx.cpp b/clang/test/CXX/drs/dr1xx.cpp --- a/clang/test/CXX/drs/dr1xx.cpp +++ b/clang/test/CXX/drs/dr1xx.cpp @@ -3,7 +3,7 @@ // RUN: %clang_cc1 -std=c++14 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors // RUN: %clang_cc1 -std=c++17 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors // RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -// RUN: %clang_cc1 -std=c++2b -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors +// RUN: %clang_cc1 -std=c++23 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors namespace dr100 { // dr100: yes template struct A {}; // expected-note 0-1{{declared here}} diff --git a/clang/test/CXX/drs/dr20xx.cpp b/clang/test/CXX/drs/dr20xx.cpp --- a/clang/test/CXX/drs/dr20xx.cpp +++ b/clang/test/CXX/drs/dr20xx.cpp @@ -4,7 +4,7 @@ // RUN: %clang_cc1 -std=c++14 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors // RUN: %clang_cc1 -std=c++17 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors // RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -// RUN: %clang_cc1 -std=c++2b -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors +// RUN: %clang_cc1 -std=c++23 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors #if __cplusplus < 201103L #define static_assert(...) _Static_assert(__VA_ARGS__) diff --git a/clang/test/CXX/drs/dr21xx.cpp b/clang/test/CXX/drs/dr21xx.cpp --- a/clang/test/CXX/drs/dr21xx.cpp +++ b/clang/test/CXX/drs/dr21xx.cpp @@ -3,7 +3,7 @@ // RUN: %clang_cc1 -std=c++14 -triple x86_64-unknown-unknown %s -verify -fexceptions -Wno-deprecated-builtins -fcxx-exceptions -pedantic-errors // RUN: %clang_cc1 -std=c++17 -triple x86_64-unknown-unknown %s -verify -fexceptions -Wno-deprecated-builtins -fcxx-exceptions -pedantic-errors // RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-unknown %s -verify -fexceptions -Wno-deprecated-builtins -fcxx-exceptions -pedantic-errors -// RUN: %clang_cc1 -std=c++2b -triple x86_64-unknown-unknown %s -verify -fexceptions -Wno-deprecated-builtins -fcxx-exceptions -pedantic-errors +// RUN: %clang_cc1 -std=c++23 -triple x86_64-unknown-unknown %s -verify -fexceptions -Wno-deprecated-builtins -fcxx-exceptions -pedantic-errors #if __cplusplus < 201103L // expected-error@+1 {{variadic macro}} diff --git a/clang/test/CXX/drs/dr23xx.cpp b/clang/test/CXX/drs/dr23xx.cpp --- a/clang/test/CXX/drs/dr23xx.cpp +++ b/clang/test/CXX/drs/dr23xx.cpp @@ -3,7 +3,7 @@ // RUN: %clang_cc1 -std=c++14 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors 2>&1 | FileCheck %s // RUN: %clang_cc1 -std=c++17 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors 2>&1 | FileCheck %s // RUN: %clang_cc1 -std=c++20 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors 2>&1 | FileCheck %s -// RUN: %clang_cc1 -std=c++2b %s -verify -fexceptions -fcxx-exceptions -pedantic-errors 2>&1 | FileCheck %s +// RUN: %clang_cc1 -std=c++23 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors 2>&1 | FileCheck %s #if __cplusplus >= 201103L namespace dr2303 { // dr2303: 12 diff --git a/clang/test/CXX/drs/dr2xx.cpp b/clang/test/CXX/drs/dr2xx.cpp --- a/clang/test/CXX/drs/dr2xx.cpp +++ b/clang/test/CXX/drs/dr2xx.cpp @@ -3,7 +3,7 @@ // RUN: %clang_cc1 -std=c++14 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors // RUN: %clang_cc1 -std=c++17 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors // RUN: %clang_cc1 -std=c++20 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -// RUN: %clang_cc1 -std=c++2b %s -verify -fexceptions -fcxx-exceptions -pedantic-errors +// RUN: %clang_cc1 -std=c++23 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors // PR13819 -- __SIZE_TYPE__ is incompatible. typedef __SIZE_TYPE__ size_t; // expected-error 0-1 {{extension}} diff --git a/clang/test/CXX/drs/dr3xx.cpp b/clang/test/CXX/drs/dr3xx.cpp --- a/clang/test/CXX/drs/dr3xx.cpp +++ b/clang/test/CXX/drs/dr3xx.cpp @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -std=c++2b -verify=expected,cxx20_2b,cxx2b -triple %itanium_abi_triple %s -fexceptions -fcxx-exceptions -pedantic-errors -// RUN: %clang_cc1 -std=c++20 -verify=expected,cxx98_20,cxx20_2b -triple %itanium_abi_triple %s -fexceptions -fcxx-exceptions -pedantic-errors +// RUN: %clang_cc1 -std=c++23 -verify=expected,cxx20_23,cxx23 -triple %itanium_abi_triple %s -fexceptions -fcxx-exceptions -pedantic-errors +// RUN: %clang_cc1 -std=c++20 -verify=expected,cxx98_20,cxx20_23 -triple %itanium_abi_triple %s -fexceptions -fcxx-exceptions -pedantic-errors // RUN: %clang_cc1 -std=c++17 -verify=expected,cxx98_17,cxx98_20 -triple %itanium_abi_triple %s -fexceptions -fcxx-exceptions -pedantic-errors // RUN: %clang_cc1 -std=c++14 -verify=expected,cxx98_17,cxx98_20 -triple %itanium_abi_triple %s -fexceptions -fcxx-exceptions -pedantic-errors // RUN: %clang_cc1 -std=c++11 -verify=expected,cxx98_17,cxx98_20 -triple %itanium_abi_triple %s -fexceptions -fcxx-exceptions -pedantic-errors @@ -20,8 +20,8 @@ void f() { bool a = (void(*)(S, S))operator+ < // expected-warning {{ordered comparison of function pointers}} (void(*)(S, S))operator+; - bool b = (void(*)(S, S))operator- < // cxx20_2b-note {{to match this '<'}} cxx98_17-warning {{ordered comparison of function pointers}} - (void(*)(S, S))operator-; // cxx20_2b-error {{expected '>'}} + bool b = (void(*)(S, S))operator- < // cxx20_23-note {{to match this '<'}} cxx98_17-warning {{ordered comparison of function pointers}} + (void(*)(S, S))operator-; // cxx20_23-error {{expected '>'}} bool c = (void(*)(S, S))operator+ < // expected-note {{to match this '<'}} (void(*)(S, S))operator-; // expected-error {{expected '>'}} } @@ -459,10 +459,10 @@ namespace dr332 { // dr332: dup 577 void f(volatile void); // expected-error {{'void' as parameter must not have type qualifiers}} - // cxx20_2b-warning@-1 {{volatile-qualified parameter type 'volatile void' is deprecated}} + // cxx20_23-warning@-1 {{volatile-qualified parameter type 'volatile void' is deprecated}} void g(const void); // expected-error {{'void' as parameter must not have type qualifiers}} void h(int n, volatile void); // expected-error {{'void' must be the first and only parameter}} - // cxx20_2b-warning@-1 {{volatile-qualified parameter type 'volatile void' is deprecated}} + // cxx20_23-warning@-1 {{volatile-qualified parameter type 'volatile void' is deprecated}} } namespace dr333 { // dr333: yes @@ -647,7 +647,7 @@ template operator T ***() { int ***p = 0; return p; // cxx98_20-error {{cannot initialize return object of type 'const int ***' with an lvalue of type 'int ***'}} - // cxx2b-error@-1 {{cannot initialize return object of type 'const int ***' with an rvalue of type 'int ***'}} + // cxx23-error@-1 {{cannot initialize return object of type 'const int ***' with an rvalue of type 'int ***'}} } }; @@ -961,12 +961,12 @@ template struct S {}; // expected-note {{here}} template int f(S *); // expected-error {{function type}} template int g(S *); // cxx98_17-note {{type 'X'}} - // cxx20_2b-note@-1 {{candidate function [with T = dr368::X]}} + // cxx20_23-note@-1 {{candidate function [with T = dr368::X]}} template int g(S *); // cxx98_17-note {{type 'X'}} - // cxx20_2b-note@-1 {{candidate function [with T = dr368::X]}} + // cxx20_23-note@-1 {{candidate function [with T = dr368::X]}} struct X {}; int n = g(0); // cxx98_17-error {{no matching}} - // cxx20_2b-error@-1 {{call to 'g' is ambiguous}} + // cxx20_23-error@-1 {{call to 'g' is ambiguous}} } // dr370: na diff --git a/clang/test/CXX/drs/dr4xx.cpp b/clang/test/CXX/drs/dr4xx.cpp --- a/clang/test/CXX/drs/dr4xx.cpp +++ b/clang/test/CXX/drs/dr4xx.cpp @@ -3,7 +3,7 @@ // RUN: env ASAN_OPTIONS=detect_stack_use_after_return=0 %clang_cc1 -std=c++14 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors // RUN: env ASAN_OPTIONS=detect_stack_use_after_return=0 %clang_cc1 -std=c++17 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors // RUN: env ASAN_OPTIONS=detect_stack_use_after_return=0 %clang_cc1 -std=c++20 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -// RUN: env ASAN_OPTIONS=detect_stack_use_after_return=0 %clang_cc1 -std=c++2b %s -verify -fexceptions -fcxx-exceptions -pedantic-errors +// RUN: env ASAN_OPTIONS=detect_stack_use_after_return=0 %clang_cc1 -std=c++23 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors // FIXME: __SIZE_TYPE__ expands to 'long long' on some targets. __extension__ typedef __SIZE_TYPE__ size_t; diff --git a/clang/test/CXX/drs/dr5xx.cpp b/clang/test/CXX/drs/dr5xx.cpp --- a/clang/test/CXX/drs/dr5xx.cpp +++ b/clang/test/CXX/drs/dr5xx.cpp @@ -3,7 +3,7 @@ // RUN: %clang_cc1 -std=c++14 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors // RUN: %clang_cc1 -std=c++17 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors // RUN: %clang_cc1 -std=c++20 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -// RUN: %clang_cc1 -std=c++2b %s -verify -fexceptions -fcxx-exceptions -pedantic-errors +// RUN: %clang_cc1 -std=c++23 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors // FIXME: This is included to avoid a diagnostic with no source location // pointing at the implicit operator new. We can't match such a diagnostic diff --git a/clang/test/CXX/drs/dr6xx.cpp b/clang/test/CXX/drs/dr6xx.cpp --- a/clang/test/CXX/drs/dr6xx.cpp +++ b/clang/test/CXX/drs/dr6xx.cpp @@ -3,7 +3,7 @@ // RUN: %clang_cc1 -std=c++14 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -fno-spell-checking // RUN: %clang_cc1 -std=c++17 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -fno-spell-checking // RUN: %clang_cc1 -std=c++20 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -fno-spell-checking -// RUN: %clang_cc1 -std=c++2b %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -fno-spell-checking +// RUN: %clang_cc1 -std=c++23 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -fno-spell-checking namespace dr600 { // dr600: yes struct S { diff --git a/clang/test/CXX/drs/dr9xx.cpp b/clang/test/CXX/drs/dr9xx.cpp --- a/clang/test/CXX/drs/dr9xx.cpp +++ b/clang/test/CXX/drs/dr9xx.cpp @@ -3,7 +3,7 @@ // RUN: %clang_cc1 -std=c++14 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors // RUN: %clang_cc1 -std=c++17 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors // RUN: %clang_cc1 -std=c++20 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -// RUN: %clang_cc1 -std=c++2b %s -verify -fexceptions -fcxx-exceptions -pedantic-errors +// RUN: %clang_cc1 -std=c++23 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors namespace std { __extension__ typedef __SIZE_TYPE__ size_t; diff --git a/clang/test/CXX/expr/expr.post/expr.type.conv/p1-2b.cpp b/clang/test/CXX/expr/expr.post/expr.type.conv/p1-2b.cpp --- a/clang/test/CXX/expr/expr.post/expr.type.conv/p1-2b.cpp +++ b/clang/test/CXX/expr/expr.post/expr.type.conv/p1-2b.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -std=c++2b -verify %s +// RUN: %clang_cc1 -std=c++23 -verify %s template void foo(T); @@ -9,7 +9,7 @@ float g(double); } a{1}; -// C++2b [dcl.type.auto.deduct]p2.3 +// C++23 [dcl.type.auto.deduct]p2.3 // For an explicit type conversion, T is the specified type, which shall be auto. void diagnostics() { foo(auto()); // expected-error {{initializer for functional-style cast to 'auto' is empty}} diff --git a/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p4-cxx14.cpp b/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p4-cxx14.cpp --- a/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p4-cxx14.cpp +++ b/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p4-cxx14.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -std=c++2b -fsyntax-only -verify=expected,cxx2b %s +// RUN: %clang_cc1 -std=c++23 -fsyntax-only -verify=expected,cxx23 %s // RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify=expected,cxx14_20 %s // RUN: %clang_cc1 -std=c++14 -fsyntax-only -verify=expected,cxx14_20 %s @@ -9,7 +9,7 @@ int &e = [] (int &r) -> auto { return r; } (a); // expected-error {{cannot bind to a temporary}} int &f = [] (int r) -> decltype(auto) { return r; } (a); // expected-error {{non-const lvalue reference to type 'int' cannot bind to a temporary of type 'int'}} int &g = [] (int r) -> decltype(auto) { return (r); } (a); // expected-warning {{reference to stack}} -// cxx2b-error@-1 {{non-const lvalue reference to type 'int' cannot bind to a temporary of type 'int'}} +// cxx23-error@-1 {{non-const lvalue reference to type 'int' cannot bind to a temporary of type 'int'}} int test_explicit_auto_return() { @@ -17,7 +17,7 @@ auto L = [](auto F, auto a) { return F(a); }; auto M = [](auto a) -> auto { return a; }; // OK auto MRef = [](auto b) -> auto & { return b; }; //cxx14_20-warning{{reference to stack}} - // cxx2b-error@-1 {{non-const lvalue reference to type 'X' cannot bind to a temporary of type 'X'}} + // cxx23-error@-1 {{non-const lvalue reference to type 'X' cannot bind to a temporary of type 'X'}} auto MPtr = [](auto c) -> auto* { return &c; }; //expected-warning{{address of stack}} auto MDeclType = [](auto&& d) -> decltype(auto) { return static_cast(d); }; //OK M(3); @@ -57,7 +57,7 @@ auto M = [] { return 5; }; // OK auto M2 = [] -> auto && { return si; }; #if __cplusplus <= 202002L - // expected-warning@-2{{is a C++2b extension}} + // expected-warning@-2{{is a C++23 extension}} #endif M(); } diff --git a/clang/test/CXX/expr/expr.unary/expr.new/p2-cxx1z.cpp b/clang/test/CXX/expr/expr.unary/expr.new/p2-cxx1z.cpp --- a/clang/test/CXX/expr/expr.unary/expr.new/p2-cxx1z.cpp +++ b/clang/test/CXX/expr/expr.unary/expr.new/p2-cxx1z.cpp @@ -2,7 +2,7 @@ // RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++17 -pedantic // [expr.new]p2 ... the invented declaration: T x init ; -// C++2b [dcl.type.auto.deduct]p2.2 +// C++23 [dcl.type.auto.deduct]p2.2 // For a variable declared with a type that contains a placeholder type, T is the declared type of the variable. void f() { // - If the initializer is a parenthesized expression-list, the expression-list shall be a single assignmentexpression and E is the assignment-expression. diff --git a/clang/test/CXX/over/over.match/over.match.best/over.best.ics/p6.cpp b/clang/test/CXX/over/over.match/over.match.best/over.best.ics/p6.cpp --- a/clang/test/CXX/over/over.match/over.match.best/over.best.ics/p6.cpp +++ b/clang/test/CXX/over/over.match/over.match.best/over.best.ics/p6.cpp @@ -1,9 +1,9 @@ -// RUN: %clang_cc1 -fsyntax-only -verify=cxx2b -std=c++2b %s +// RUN: %clang_cc1 -fsyntax-only -verify=cxx23 -std=c++23 %s // RUN: %clang_cc1 -fsyntax-only -verify=cxx20 -std=c++20 %s -// cxx2b-no-diagnostics +// cxx23-no-diagnostics struct __unique { - static constexpr auto operator()() { return 4; }; // cxx20-warning {{is a C++2b extension}} + static constexpr auto operator()() { return 4; }; // cxx20-warning {{is a C++23 extension}} using P = int(); constexpr operator P*() { return operator(); } diff --git a/clang/test/CXX/over/over.oper/p7.cpp b/clang/test/CXX/over/over.oper/p7.cpp --- a/clang/test/CXX/over/over.oper/p7.cpp +++ b/clang/test/CXX/over/over.oper/p7.cpp @@ -1,15 +1,15 @@ // RUN: %clang_cc1 -std=c++11 %s -verify=expected,cxx11 -// RUN: %clang_cc1 -std=c++2b %s -verify=expected,cxx2b -// RUN: %clang_cc1 -std=c++2b -Wpre-c++2b-compat %s -verify=expected,precxx2b +// RUN: %clang_cc1 -std=c++23 %s -verify=expected,cxx23 +// RUN: %clang_cc1 -std=c++23 -Wpre-c++23-compat %s -verify=expected,precxx23 struct Functor { static int operator()(int a, int b); static int operator[](int a1); - // cxx11-warning@-2 {{declaring overloaded 'operator()' as 'static' is a C++2b extension}} - // cxx11-warning@-2 {{declaring overloaded 'operator[]' as 'static' is a C++2b extension}} - // precxx2b-warning@-4 {{incompatible with C++ standards before C++2b}} - // precxx2b-warning@-4 {{incompatible with C++ standards before C++2b}} + // cxx11-warning@-2 {{declaring overloaded 'operator()' as 'static' is a C++23 extension}} + // cxx11-warning@-2 {{declaring overloaded 'operator[]' as 'static' is a C++23 extension}} + // precxx23-warning@-4 {{incompatible with C++ standards before C++23}} + // precxx23-warning@-4 {{incompatible with C++ standards before C++23}} }; struct InvalidParsing1 { diff --git a/clang/test/CXX/special/class.copy/p3-cxx11.cpp b/clang/test/CXX/special/class.copy/p3-cxx11.cpp --- a/clang/test/CXX/special/class.copy/p3-cxx11.cpp +++ b/clang/test/CXX/special/class.copy/p3-cxx11.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fcxx-exceptions -fexceptions -std=c++2b -fsyntax-only -verify %s +// RUN: %clang_cc1 -fcxx-exceptions -fexceptions -std=c++23 -fsyntax-only -verify %s // RUN: %clang_cc1 -fcxx-exceptions -fexceptions -std=c++20 -fsyntax-only -verify %s // RUN: %clang_cc1 -fcxx-exceptions -fexceptions -std=c++11 -fsyntax-only -verify %s class X { diff --git a/clang/test/CXX/stmt.stmt/stmt.select/stmt.if/p4.cpp b/clang/test/CXX/stmt.stmt/stmt.select/stmt.if/p4.cpp --- a/clang/test/CXX/stmt.stmt/stmt.select/stmt.if/p4.cpp +++ b/clang/test/CXX/stmt.stmt/stmt.select/stmt.if/p4.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -std=c++2b -verify %s +// RUN: %clang_cc1 -std=c++23 -verify %s void test_consteval() { if consteval ({(void)1;}); // expected-error {{expected { after consteval}} diff --git a/clang/test/CXX/temp/temp.decls/temp.mem/p5.cpp b/clang/test/CXX/temp/temp.decls/temp.mem/p5.cpp --- a/clang/test/CXX/temp/temp.decls/temp.mem/p5.cpp +++ b/clang/test/CXX/temp/temp.decls/temp.mem/p5.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -std=c++2b -fsyntax-only -verify=expected,cxx2b %s +// RUN: %clang_cc1 -std=c++23 -fsyntax-only -verify=expected,cxx23 %s // RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify=expected,cxx98_20 %s // RUN: %clang_cc1 -std=c++98 -fsyntax-only -verify=expected,cxx98_20 %s // RUN: %clang_cc1 -fsyntax-only -verify=expected,cxx98_20 %s @@ -69,8 +69,8 @@ T x = T(); return x; // cxx98_20-error{{cannot initialize return object of type 'const char *' with an lvalue of type 'char'}} \ // cxx98_20-error{{cannot initialize return object of type 'const int *' with an lvalue of type 'int'}} \ - // cxx2b-error{{cannot initialize return object of type 'const char *' with an rvalue of type 'char'}} \ - // cxx2b-error{{cannot initialize return object of type 'const int *' with an rvalue of type 'int'}} + // cxx23-error{{cannot initialize return object of type 'const char *' with an rvalue of type 'char'}} \ + // cxx23-error{{cannot initialize return object of type 'const int *' with an rvalue of type 'int'}} } }; diff --git a/clang/test/CXX/temp/temp.decls/temp.variadic/p5.cpp b/clang/test/CXX/temp/temp.decls/temp.variadic/p5.cpp --- a/clang/test/CXX/temp/temp.decls/temp.variadic/p5.cpp +++ b/clang/test/CXX/temp/temp.decls/temp.variadic/p5.cpp @@ -1,5 +1,5 @@ // RUN: %clang_cc1 -fcxx-exceptions -fexceptions -std=c++11 -fblocks -fms-extensions -fsyntax-only -verify=expected,cxx11 %s -// RUN: %clang_cc1 -fcxx-exceptions -fexceptions -std=c++2b -fblocks -fms-extensions -fsyntax-only -verify=expected %s +// RUN: %clang_cc1 -fcxx-exceptions -fexceptions -std=c++23 -fblocks -fms-extensions -fsyntax-only -verify=expected %s template struct pair; template struct tuple; diff --git a/clang/test/CodeGenCXX/cxx2b-consteval-if.cpp b/clang/test/CodeGenCXX/cxx2b-consteval-if.cpp --- a/clang/test/CodeGenCXX/cxx2b-consteval-if.cpp +++ b/clang/test/CodeGenCXX/cxx2b-consteval-if.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -std=c++2b %s -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 -std=c++23 %s -emit-llvm -o - | FileCheck %s void should_be_used_1(); void should_be_used_2(); diff --git a/clang/test/CodeGenCXX/cxx2b-static-call-operator.cpp b/clang/test/CodeGenCXX/cxx2b-static-call-operator.cpp --- a/clang/test/CodeGenCXX/cxx2b-static-call-operator.cpp +++ b/clang/test/CodeGenCXX/cxx2b-static-call-operator.cpp @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -std=c++2b %s -emit-llvm -triple x86_64-linux -o - | FileCheck %s -// RUN: %clang_cc1 -std=c++2b %s -emit-llvm -triple x86_64-windows-msvc -o - | FileCheck %s +// RUN: %clang_cc1 -std=c++23 %s -emit-llvm -triple x86_64-linux -o - | FileCheck %s +// RUN: %clang_cc1 -std=c++23 %s -emit-llvm -triple x86_64-windows-msvc -o - | FileCheck %s struct Functor { static int operator()(int x, int y) { diff --git a/clang/test/CodeGenCXX/cxx2b-static-subscript-operator.cpp b/clang/test/CodeGenCXX/cxx2b-static-subscript-operator.cpp --- a/clang/test/CodeGenCXX/cxx2b-static-subscript-operator.cpp +++ b/clang/test/CodeGenCXX/cxx2b-static-subscript-operator.cpp @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -std=c++2b %s -emit-llvm -triple x86_64-linux -o - | FileCheck %s -// RUN: %clang_cc1 -std=c++2b %s -emit-llvm -triple x86_64-windows-msvc -o - | FileCheck %s +// RUN: %clang_cc1 -std=c++23 %s -emit-llvm -triple x86_64-linux -o - | FileCheck %s +// RUN: %clang_cc1 -std=c++23 %s -emit-llvm -triple x86_64-windows-msvc -o - | FileCheck %s struct Functor { static int operator[](int x, int y) { diff --git a/clang/test/CoverageMapping/if.cpp b/clang/test/CoverageMapping/if.cpp --- a/clang/test/CoverageMapping/if.cpp +++ b/clang/test/CoverageMapping/if.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fms-extensions -mllvm -emptyline-comment-coverage=false -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -std=c++2b -triple %itanium_abi_triple -main-file-name if.cpp %s | FileCheck %s +// RUN: %clang_cc1 -fms-extensions -mllvm -emptyline-comment-coverage=false -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -std=c++23 -triple %itanium_abi_triple -main-file-name if.cpp %s | FileCheck %s int nop() { return 0; } struct S { diff --git a/clang/test/CoverageMapping/strong_order.cpp b/clang/test/CoverageMapping/strong_order.cpp --- a/clang/test/CoverageMapping/strong_order.cpp +++ b/clang/test/CoverageMapping/strong_order.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -mllvm -emptyline-comment-coverage=false -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -std=c++2b -triple %itanium_abi_triple -main-file-name if.cpp %s +// RUN: %clang_cc1 -mllvm -emptyline-comment-coverage=false -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -std=c++23 -triple %itanium_abi_triple -main-file-name if.cpp %s // No crash for following example. // See https://github.com/llvm/llvm-project/issues/45481 diff --git a/clang/test/Driver/cl-options.c b/clang/test/Driver/cl-options.c --- a/clang/test/Driver/cl-options.c +++ b/clang/test/Driver/cl-options.c @@ -604,7 +604,7 @@ // STDCXX20: -std=c++20 // RUN: %clang_cl -fmsc-version=1900 -TP -std:c++latest -### -- %s 2>&1 | FileCheck -check-prefix=STDCXXLATEST %s -// STDCXXLATEST: -std=c++2b +// STDCXXLATEST: -std=c++23 // RUN: env CL="/Gy" %clang_cl -### -- %s 2>&1 | FileCheck -check-prefix=ENV-CL %s // ENV-CL: "-ffunction-sections" diff --git a/clang/test/Driver/modules-fprebuilt-mdoule-path.cpp b/clang/test/Driver/modules-fprebuilt-mdoule-path.cpp --- a/clang/test/Driver/modules-fprebuilt-mdoule-path.cpp +++ b/clang/test/Driver/modules-fprebuilt-mdoule-path.cpp @@ -1,6 +1,6 @@ // RUN: %clang -std=c++2a -fprebuilt-module-path=. -### -c %s 2>&1 | FileCheck %s // RUN: %clang -std=c++20 -fprebuilt-module-path=. -### -c %s 2>&1 | FileCheck %s -// RUN: %clang -std=c++2b -fprebuilt-module-path=. -### -c %s 2>&1 | FileCheck %s +// RUN: %clang -std=c++23 -fprebuilt-module-path=. -### -c %s 2>&1 | FileCheck %s // RUN: %clang -std=c++latest -fprebuilt-module-path=. -### -c %s 2>&1 | FileCheck %s // // CHECK-NOT: warning: argument unused during compilation diff --git a/clang/test/Driver/std.cpp b/clang/test/Driver/std.cpp --- a/clang/test/Driver/std.cpp +++ b/clang/test/Driver/std.cpp @@ -11,8 +11,8 @@ // RUN: not %clang -std=gnu++1z %s -fsyntax-only 2>&1 | FileCheck -check-prefix=GNUXX1Z %s // RUN: not %clang -std=c++2a %s -fsyntax-only 2>&1 | FileCheck -check-prefix=CXX2A %s // RUN: not %clang -std=gnu++2a %s -fsyntax-only 2>&1 | FileCheck -check-prefix=GNUXX2A %s -// RUN: not %clang -std=c++2b %s -fsyntax-only 2>&1 | FileCheck -check-prefix=CXX2B %s -// RUN: not %clang -std=gnu++2b %s -fsyntax-only 2>&1 | FileCheck -check-prefix=GNUXX2B %s +// RUN: not %clang -std=c++23 %s -fsyntax-only 2>&1 | FileCheck -check-prefix=CXX2B %s +// RUN: not %clang -std=gnu++23 %s -fsyntax-only 2>&1 | FileCheck -check-prefix=GNUXX2B %s void f(int n) { typeof(n)(); diff --git a/clang/test/Driver/unknown-std.cpp b/clang/test/Driver/unknown-std.cpp --- a/clang/test/Driver/unknown-std.cpp +++ b/clang/test/Driver/unknown-std.cpp @@ -17,8 +17,8 @@ // CHECK-NEXT: note: use 'gnu++17' for 'ISO C++ 2017 with amendments and GNU extensions' standard // CHECK-NEXT: note: use 'c++20' for 'ISO C++ 2020 DIS' standard // CHECK-NEXT: note: use 'gnu++20' for 'ISO C++ 2020 DIS with GNU extensions' standard -// CHECK-NEXT: note: use 'c++2b' for 'Working draft for ISO C++ 2023 DIS' standard -// CHECK-NEXT: note: use 'gnu++2b' for 'Working draft for ISO C++ 2023 DIS with GNU extensions' standard +// CHECK-NEXT: note: use 'c++23' for 'ISO C++ 2023 DIS' standard +// CHECK-NEXT: note: use 'gnu++23' for 'ISO C++ 2023 DIS with GNU extensions' standard // CUDA-NEXT: note: use 'cuda' for 'NVIDIA CUDA(tm)' standard // Make sure that no other output is present. diff --git a/clang/test/FixIt/fixit-c++11.cpp b/clang/test/FixIt/fixit-c++11.cpp --- a/clang/test/FixIt/fixit-c++11.cpp +++ b/clang/test/FixIt/fixit-c++11.cpp @@ -59,8 +59,8 @@ (void)[] mutable {}; (void)[]->int{}; #if __cplusplus <= 202002L - // expected-warning@-3{{is a C++2b extension}} - // expected-warning@-3{{is a C++2b extension}} + // expected-warning@-3{{is a C++23 extension}} + // expected-warning@-3{{is a C++23 extension}} #endif delete []() { return new int; }(); // expected-error{{'[]' after delete interpreted as 'delete[]'}} diff --git a/clang/test/Lexer/char-escapes-delimited.c b/clang/test/Lexer/char-escapes-delimited.c --- a/clang/test/Lexer/char-escapes-delimited.c +++ b/clang/test/Lexer/char-escapes-delimited.c @@ -1,6 +1,6 @@ // RUN: %clang_cc1 -x c++ -std=gnu++11 -fsyntax-only -pedantic -verify=ext,expected %s // RUN: %clang_cc1 -x c -std=gnu11 -fsyntax-only -pedantic -verify=ext,expected %s -// RUN: %clang_cc1 -x c++ -std=c++2b -fsyntax-only -pedantic -verify=cxx2b,expected -Wpre-c++2b-compat %s +// RUN: %clang_cc1 -x c++ -std=c++23 -fsyntax-only -pedantic -verify=cxx23,expected -Wpre-c++23-compat %s // RUN: %clang_cc1 -x c++ -std=gnu++11 -fwchar-type=short -fno-signed-wchar -fsyntax-only -pedantic -verify=ext,expected %s // RUN: %clang_cc1 -x c -std=gnu11 -fwchar-type=short -fno-signed-wchar -fsyntax-only -pedantic -verify=ext,expected %s // RUN: %clang_cc1 -x c++ -std=c++17 -ftrigraphs -fsyntax-only -pedantic -verify=ext,expected -DTRIGRAPHS=1 %s @@ -21,47 +21,47 @@ void ucn(void) { char a = '\u{1234}'; // expected-error {{character too large for enclosing character literal type}} \ - // ext-warning {{extension}} cxx2b-warning {{C++2b}} + // ext-warning {{extension}} cxx23-warning {{C++23}} - unsigned b = U'\u{1234}'; // ext-warning {{extension}} cxx2b-warning {{C++2b}} + unsigned b = U'\u{1234}'; // ext-warning {{extension}} cxx23-warning {{C++23}} #ifdef __cplusplus - unsigned b2 = U'\u{1}'; // ext-warning {{extension}} cxx2b-warning {{C++2b}} + unsigned b2 = U'\u{1}'; // ext-warning {{extension}} cxx23-warning {{C++23}} #else unsigned b2 = U'\u{1}'; //expected-error {{universal character name refers to a control character}} #endif - unsigned c = U'\u{000000000001234}'; // ext-warning {{extension}} cxx2b-warning {{C++2b}} + unsigned c = U'\u{000000000001234}'; // ext-warning {{extension}} cxx23-warning {{C++23}} unsigned d = U'\u{111111111}'; //expected-error {{hex escape sequence out of range}} } void hex(void) { - char a = '\x{1}'; // ext-warning {{extension}} cxx2b-warning {{C++2b}} + char a = '\x{1}'; // ext-warning {{extension}} cxx23-warning {{C++23}} char b = '\x{abcdegggggabc}'; // expected-error 5{{invalid digit 'g' in escape sequence}} char c = '\x{ff1}'; // expected-error {{hex escape sequence out of range}} #if __WCHAR_MAX__ > 0xFFFF - unsigned d = L'\x{FFFFFFFF}'; // ext-warning {{extension}} cxx2b-warning {{C++2b}} + unsigned d = L'\x{FFFFFFFF}'; // ext-warning {{extension}} cxx23-warning {{C++23}} unsigned e = L'\x{100000000}'; // expected-error {{hex escape sequence out of range}} #else - unsigned f = L'\x{FFFF}'; // ext-warning {{extension}} cxx2b-warning {{C++2b}} + unsigned f = L'\x{FFFF}'; // ext-warning {{extension}} cxx23-warning {{C++23}} unsigned g = L'\x{10000}'; // expected-error {{hex escape sequence out of range}} #endif - unsigned h = U'\x{FFFFFFFF}'; // ext-warning {{extension}} cxx2b-warning {{C++2b}} + unsigned h = U'\x{FFFFFFFF}'; // ext-warning {{extension}} cxx23-warning {{C++23}} unsigned i = U'\x{100000000}'; // expected-error {{hex escape sequence out of range}} } void octal(void) { - char a = '\o{1}'; // ext-warning {{extension}} cxx2b-warning {{C++2b}} + char a = '\o{1}'; // ext-warning {{extension}} cxx23-warning {{C++23}} char b = '\o{12345678881238}'; // expected-error 4{{invalid digit '8' in escape sequence}} char c = '\o{777}'; // //expected-error {{octal escape sequence out of range}} #if __WCHAR_MAX__ > 0xFFFF - unsigned d = L'\o{37777777777}'; // ext-warning {{extension}} cxx2b-warning {{C++2b}} + unsigned d = L'\o{37777777777}'; // ext-warning {{extension}} cxx23-warning {{C++23}} unsigned e = L'\o{40000000000}'; // expected-error {{octal escape sequence out of range}} unsigned f = L'\o{100000000000}'; // expected-error {{octal escape sequence out of range}} unsigned g = L'\o{200000000000}'; // expected-error {{octal escape sequence out of range}} #else - unsigned d = L'\o{177777}'; // ext-warning {{extension}} cxx2b-warning {{C++2b}} + unsigned d = L'\o{177777}'; // ext-warning {{extension}} cxx23-warning {{C++23}} unsigned e = L'\o{200000}'; // expected-error {{octal escape sequence out of range}} #endif } @@ -78,9 +78,9 @@ void named(void) { char a = '\N{LOTUS}'; // expected-error{{character too large for enclosing character literal type}} \ - // ext-warning {{extension}} cxx2b-warning {{C++2b}} + // ext-warning {{extension}} cxx23-warning {{C++23}} - char b = '\N{DOLLAR SIGN}'; // ext-warning {{extension}} cxx2b-warning {{C++2b}} + char b = '\N{DOLLAR SIGN}'; // ext-warning {{extension}} cxx23-warning {{C++23}} char b_ = '\N{ DOL-LAR _SIGN }'; // expected-error {{' DOL-LAR _SIGN ' is not a valid Unicode character name}} \ // expected-note {{characters names in Unicode escape sequences are sensitive to case and whitespaces}} @@ -89,13 +89,13 @@ char d = '\N{}'; // expected-error {{delimited escape sequence cannot be empty}} char e = '\N{'; // expected-error {{incomplete universal character name}} - unsigned f = L'\N{GREEK CAPITAL LETTER DELTA}'; // ext-warning {{extension}} cxx2b-warning {{C++2b}} + unsigned f = L'\N{GREEK CAPITAL LETTER DELTA}'; // ext-warning {{extension}} cxx23-warning {{C++23}} unsigned g = u'\N{LOTUS}'; // expected-error {{character too large for enclosing character literal type}} \ - // ext-warning {{extension}} cxx2b-warning {{C++2b}} + // ext-warning {{extension}} cxx23-warning {{C++23}} - unsigned h = U'\N{LOTUS}'; // ext-warning {{extension}} cxx2b-warning {{C++2b}} - unsigned i = u'\N{GREEK CAPITAL LETTER DELTA}'; // ext-warning {{extension}} cxx2b-warning {{C++2b}} + unsigned h = U'\N{LOTUS}'; // ext-warning {{extension}} cxx23-warning {{C++23}} + unsigned i = u'\N{GREEK CAPITAL LETTER DELTA}'; // ext-warning {{extension}} cxx23-warning {{C++23}} char j = '\NN'; // expected-error {{expected '{' after '\N' escape sequence}} expected-warning {{multi-character character constant}} unsigned k = u'\N{LOTUS'; // expected-error {{incomplete universal character name}} @@ -115,11 +115,11 @@ // expected-warning@-2 3{{expression result unused}} } -#if L'\N{GREEK CAPITAL LETTER GAMMA}' != L'Γ' // ext-warning {{extension}} cxx2b-warning {{C++2b}} +#if L'\N{GREEK CAPITAL LETTER GAMMA}' != L'Γ' // ext-warning {{extension}} cxx23-warning {{C++23}} #error "oh no!" #endif #ifdef TRIGRAPHS static_assert('\N??' == '$'); // expected-warning 2{{trigraph converted}} \ - // ext-warning {{extension}} cxx2b-warning {{C++2b}} + // ext-warning {{extension}} cxx23-warning {{C++23}} #endif diff --git a/clang/test/Lexer/cxx-features.cpp b/clang/test/Lexer/cxx-features.cpp --- a/clang/test/Lexer/cxx-features.cpp +++ b/clang/test/Lexer/cxx-features.cpp @@ -3,7 +3,7 @@ // RUN: %clang_cc1 -std=c++14 -fcxx-exceptions -fsized-deallocation -verify %s // RUN: %clang_cc1 -std=c++17 -fcxx-exceptions -fsized-deallocation -verify %s // RUN: %clang_cc1 -std=c++20 -fcxx-exceptions -fsized-deallocation -verify %s -// RUN: %clang_cc1 -std=c++2b -fcxx-exceptions -fsized-deallocation -verify %s +// RUN: %clang_cc1 -std=c++23 -fcxx-exceptions -fsized-deallocation -verify %s // // RUN: %clang_cc1 -std=c++17 -fcxx-exceptions -fsized-deallocation -frelaxed-template-template-args -DRELAXED_TEMPLATE_TEMPLATE_ARGS=1 -verify %s // RUN: %clang_cc1 -std=c++17 -fcxx-exceptions -fsized-deallocation -DCONCEPTS_TS=1 -verify %s @@ -28,7 +28,7 @@ #define check(macro, cxx98, cxx11, cxx14, cxx17, cxx20, cxx23) (cxx23 == 0 ? defined(__cpp_##macro) : __cpp_##macro != cxx23) #endif -// --- C++2b features --- +// --- C++23 features --- #if check(implicit_move, 0, 0, 0, 0, 0, 202011) #error "wrong value for __cpp_implicit_move" diff --git a/clang/test/Lexer/size_t-literal.cpp b/clang/test/Lexer/size_t-literal.cpp --- a/clang/test/Lexer/size_t-literal.cpp +++ b/clang/test/Lexer/size_t-literal.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -std=c++2b -fsyntax-only -verify %s +// RUN: %clang_cc1 -std=c++23 -fsyntax-only -verify %s #if 1z != 1 #error "z suffix must be recognized by preprocessor" diff --git a/clang/test/Modules/gmodules-deduction-guide.cpp b/clang/test/Modules/gmodules-deduction-guide.cpp --- a/clang/test/Modules/gmodules-deduction-guide.cpp +++ b/clang/test/Modules/gmodules-deduction-guide.cpp @@ -1,6 +1,6 @@ // REQUIRES: asserts -// RUN: %clang_cc1 -std=c++2b -x c++-header -emit-pch -fmodule-format=obj -I %S/Inputs \ +// RUN: %clang_cc1 -std=c++23 -x c++-header -emit-pch -fmodule-format=obj -I %S/Inputs \ // RUN: -o %t.pch %S/Inputs/gmodules-deduction-guide.h \ // RUN: -mllvm -debug-only=pchcontainer &>%t-pch.ll // RUN: cat %t-pch.ll | FileCheck %s diff --git a/clang/test/Modules/merge-constrained-friends.cpp b/clang/test/Modules/merge-constrained-friends.cpp --- a/clang/test/Modules/merge-constrained-friends.cpp +++ b/clang/test/Modules/merge-constrained-friends.cpp @@ -2,8 +2,8 @@ // RUN: mkdir -p %t // RUN: split-file %s %t // -// RUN: %clang_cc1 -std=c++2b %t/A.cppm -emit-module-interface -o %t/A.pcm -// RUN: %clang_cc1 -std=c++2b %t/Use.cpp -fprebuilt-module-path=%t -fsyntax-only -verify +// RUN: %clang_cc1 -std=c++23 %t/A.cppm -emit-module-interface -o %t/A.pcm +// RUN: %clang_cc1 -std=c++23 %t/Use.cpp -fprebuilt-module-path=%t -fsyntax-only -verify //--- A.cppm module; diff --git a/clang/test/OpenMP/target_update_messages.cpp b/clang/test/OpenMP/target_update_messages.cpp --- a/clang/test/OpenMP/target_update_messages.cpp +++ b/clang/test/OpenMP/target_update_messages.cpp @@ -6,7 +6,7 @@ // RUN: %clang_cc1 -verify=expected,ge50,lt51 -fopenmp-simd -fopenmp-version=50 -ferror-limit 100 -o - -std=c++11 %s -Wuninitialized // RUN: %clang_cc1 -verify=expected,ge50,ge51 -fopenmp-simd -fopenmp-version=51 -ferror-limit 100 -o - -std=c++11 %s -Wuninitialized -// RUN: %clang_cc1 -verify=expected,ge50,ge51,cxx2b -fopenmp -fopenmp-simd -fopenmp-version=51 -x c++ -std=c++2b %s -Wuninitialized +// RUN: %clang_cc1 -verify=expected,ge50,ge51,cxx23 -fopenmp -fopenmp-simd -fopenmp-version=51 -x c++ -std=c++23 %s -Wuninitialized void xxx(int argc) { int x; // expected-note {{initialize the variable 'x' to silence this warning}} @@ -228,7 +228,7 @@ #if defined(__cplusplus) && __cplusplus >= 202101L -namespace cxx2b { +namespace cxx23 { struct S { int operator[](auto...); @@ -240,22 +240,22 @@ #pragma omp target update to(test[1]) -#pragma omp target update to(test[1, 2]) // cxx2b-error {{type 'int[10]' does not provide a subscript operator}} \ - // cxx2b-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}} +#pragma omp target update to(test[1, 2]) // cxx23-error {{type 'int[10]' does not provide a subscript operator}} \ + // cxx23-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}} #pragma omp target update to(test [1:1:1]) -#pragma omp target update to(test [1, 2:1:1]) // cxx2b-error {{expected ']'}} // expected-note {{'['}} \ - // cxx2b-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}} +#pragma omp target update to(test [1, 2:1:1]) // cxx23-error {{expected ']'}} // expected-note {{'['}} \ + // cxx23-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}} -#pragma omp target update to(test [1, 2:]) // cxx2b-error {{expected ']'}} // expected-note {{'['}} \ - // cxx2b-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}} +#pragma omp target update to(test [1, 2:]) // cxx23-error {{expected ']'}} // expected-note {{'['}} \ + // cxx23-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}} -#pragma omp target update to(test[1, 2 ::]) // cxx2b-error {{expected ']'}} // expected-note {{'['}} \ - // cxx2b-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}} +#pragma omp target update to(test[1, 2 ::]) // cxx23-error {{expected ']'}} // expected-note {{'['}} \ + // cxx23-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}} -#pragma omp target update to(test[]) // cxx2b-error {{type 'int[10]' does not provide a subscript operator}} \ - // cxx2b-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}} +#pragma omp target update to(test[]) // cxx23-error {{type 'int[10]' does not provide a subscript operator}} \ + // cxx23-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}} S s; (void)s[0]; (void)s[]; diff --git a/clang/test/Parser/cxx-concepts-requires-clause.cpp b/clang/test/Parser/cxx-concepts-requires-clause.cpp --- a/clang/test/Parser/cxx-concepts-requires-clause.cpp +++ b/clang/test/Parser/cxx-concepts-requires-clause.cpp @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -std=c++2a -x c++ %s -verify -// RUN: %clang_cc1 -std=c++2b -x c++ %s -verify +// RUN: %clang_cc1 -std=c++20 -x c++ %s -verify +// RUN: %clang_cc1 -std=c++23 -x c++ %s -verify // Test parsing of the optional requires-clause in a template-declaration. @@ -166,5 +166,5 @@ auto lambda4 = [] requires(sizeof(char) == 1){}; // expected-error {{expected body of lambda expression}} #if __cplusplus <= 202002L -// expected-warning@-2{{lambda without a parameter clause is a C++2b extension}} +// expected-warning@-2{{lambda without a parameter clause is a C++23 extension}} #endif diff --git a/clang/test/Parser/cxx0x-lambda-expressions.cpp b/clang/test/Parser/cxx0x-lambda-expressions.cpp --- a/clang/test/Parser/cxx0x-lambda-expressions.cpp +++ b/clang/test/Parser/cxx0x-lambda-expressions.cpp @@ -1,6 +1,6 @@ // RUN: %clang_cc1 -fsyntax-only -Wno-unused-value -verify -std=c++11 -Wno-c99-designator %s -// RUN: %clang_cc1 -fsyntax-only -Wno-unused-value -verify -std=c++2a -Wno-c99-designator %s -// RUN: %clang_cc1 -fsyntax-only -Wno-unused-value -verify -std=c++2b -Wno-c99-designator %s +// RUN: %clang_cc1 -fsyntax-only -Wno-unused-value -verify -std=c++20 -Wno-c99-designator %s +// RUN: %clang_cc1 -fsyntax-only -Wno-unused-value -verify -std=c++23 -Wno-c99-designator %s enum E { e }; @@ -31,8 +31,8 @@ [] -> int { return 0; }; [] mutable -> int { return 0; }; #if __cplusplus <= 202002L - // expected-warning@-3 {{lambda without a parameter clause is a C++2b extension}} - // expected-warning@-3 {{is a C++2b extension}} + // expected-warning@-3 {{lambda without a parameter clause is a C++23 extension}} + // expected-warning@-3 {{is a C++23 extension}} #endif [](int) -> {}; // PR13652 expected-error {{expected a type}} return 1; @@ -108,7 +108,7 @@ void attributes() { [] __attribute__((noreturn)){}; #if __cplusplus <= 202002L - // expected-warning@-2 {{is a C++2b extension}} + // expected-warning@-2 {{is a C++23 extension}} #endif []() [[]] mutable {}; // expected-error {{expected body of lambda expression}} @@ -128,17 +128,17 @@ // rather than the type. [][[]](){}; #if __cplusplus <= 202002L - // expected-warning@-2 {{an attribute specifier sequence in this position is a C++2b extension}} + // expected-warning@-2 {{an attribute specifier sequence in this position is a C++23 extension}} #endif #if __cplusplus > 201703L [][[]](){}; #if __cplusplus <= 202002L - // expected-warning@-2 {{an attribute specifier sequence in this position is a C++2b extension}} + // expected-warning@-2 {{an attribute specifier sequence in this position is a C++23 extension}} #endif #endif [][[]]{}; #if __cplusplus <= 202002L - // expected-warning@-2 {{an attribute specifier sequence in this position is a C++2b extension}} + // expected-warning@-2 {{an attribute specifier sequence in this position is a C++23 extension}} #endif } @@ -146,8 +146,8 @@ [] mutable {}; [] noexcept {}; #if __cplusplus <= 202002L - // expected-warning@-3 {{is a C++2b extension}} - // expected-warning@-3 {{is a C++2b extension}} + // expected-warning@-3 {{is a C++23 extension}} + // expected-warning@-3 {{is a C++23 extension}} #endif } }; diff --git a/clang/test/Parser/cxx1z-constexpr-lambdas.cpp b/clang/test/Parser/cxx1z-constexpr-lambdas.cpp --- a/clang/test/Parser/cxx1z-constexpr-lambdas.cpp +++ b/clang/test/Parser/cxx1z-constexpr-lambdas.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -std=c++2b %s -verify +// RUN: %clang_cc1 -std=c++23 %s -verify // RUN: %clang_cc1 -std=c++20 %s -verify // RUN: %clang_cc1 -std=c++17 %s -verify // RUN: %clang_cc1 -std=c++14 %s -verify @@ -9,7 +9,7 @@ // expected-warning@-2 {{is a C++17 extension}} #endif #if __cplusplus <= 202002L -// expected-warning@-5 {{lambda without a parameter clause is a C++2b extension}} +// expected-warning@-5 {{lambda without a parameter clause is a C++23 extension}} #endif auto XL1 = []() mutable // mutable // expected-error{{cannot appear multiple times}} diff --git a/clang/test/Parser/cxx2a-template-lambdas.cpp b/clang/test/Parser/cxx2a-template-lambdas.cpp --- a/clang/test/Parser/cxx2a-template-lambdas.cpp +++ b/clang/test/Parser/cxx2a-template-lambdas.cpp @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -std=c++2b %s -verify -// RUN: %clang_cc1 -std=c++2a %s -verify +// RUN: %clang_cc1 -std=c++23 %s -verify +// RUN: %clang_cc1 -std=c++20 %s -verify auto L0 = []<> { }; //expected-error {{cannot be empty}} @@ -14,14 +14,14 @@ auto L7 = []() noexcept {}; auto L8 = [] noexcept {}; #if __cplusplus <= 202002L -// expected-warning@-2 {{lambda without a parameter clause is a C++2b extension}} +// expected-warning@-2 {{lambda without a parameter clause is a C++23 extension}} #endif auto L9 = [] requires true {}; auto L10 = [] requires true(){}; auto L11 = [] requires true() noexcept {}; auto L12 = [] requires true noexcept {}; #if __cplusplus <= 202002L -// expected-warning@-2 {{is a C++2b extension}} +// expected-warning@-2 {{is a C++23 extension}} #endif auto L13 = []() noexcept requires true {}; auto L14 = [] requires true() noexcept requires true {}; @@ -29,6 +29,6 @@ auto XL0 = [] noexcept requires true {}; // expected-error {{expected body of lambda expression}} auto XL1 = [] requires true noexcept requires true {}; // expected-error {{expected body}} #if __cplusplus <= 202002L -// expected-warning@-3 {{is a C++2b extension}} -// expected-warning@-3 {{is a C++2b extension}} +// expected-warning@-3 {{is a C++23 extension}} +// expected-warning@-3 {{is a C++23 extension}} #endif diff --git a/clang/test/Parser/cxx2b-auto-x.cpp b/clang/test/Parser/cxx2b-auto-x.cpp --- a/clang/test/Parser/cxx2b-auto-x.cpp +++ b/clang/test/Parser/cxx2b-auto-x.cpp @@ -1,14 +1,14 @@ -// RUN: %clang_cc1 -fsyntax-only -verify=expected,cxx2b -std=c++2b -Wpre-c++2b-compat %s +// RUN: %clang_cc1 -fsyntax-only -verify=expected,cxx23 -std=c++23 -Wpre-c++23-compat %s // RUN: %clang_cc1 -fsyntax-only -verify=expected,cxx20 -std=c++20 %s void looks_like_decltype_auto() { decltype(auto(42)) b = 42; // cxx20-error {{'auto' not allowed here}} \ - cxx2b-warning {{'auto' as a functional-style cast is incompatible with C++ standards before C++2b}} + cxx23-warning {{'auto' as a functional-style cast is incompatible with C++ standards before C++23}} decltype(long *) a = 42; // expected-error {{expected '(' for function-style cast or type construction}} \ expected-error {{expected expression}} decltype(auto *) a = 42; // expected-error {{expected '(' for function-style cast or type construction}} \ expected-error {{expected expression}} - decltype(auto()) c = 42; // cxx2b-error {{initializer for functional-style cast to 'auto' is empty}} \ + decltype(auto()) c = 42; // cxx23-error {{initializer for functional-style cast to 'auto' is empty}} \ cxx20-error {{'auto' not allowed here}} } diff --git a/clang/test/Parser/cxx2b-init-statement.cpp b/clang/test/Parser/cxx2b-init-statement.cpp --- a/clang/test/Parser/cxx2b-init-statement.cpp +++ b/clang/test/Parser/cxx2b-init-statement.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fsyntax-only -verify=expected -std=c++2b -Wall %s +// RUN: %clang_cc1 -fsyntax-only -verify=expected -std=c++23 -Wall %s // RUN: %clang_cc1 -fsyntax-only -verify=expected,expected-cxx20 -std=c++20 -Wall %s namespace ns { @@ -7,13 +7,13 @@ } void f() { - for (using foo = int;true;); //expected-cxx20-warning {{alias declaration in this context is a C++2b extension}} + for (using foo = int;true;); //expected-cxx20-warning {{alias declaration in this context is a C++23 extension}} - switch(using foo = int; 0) { //expected-cxx20-warning {{alias declaration in this context is a C++2b extension}} + switch(using foo = int; 0) { //expected-cxx20-warning {{alias declaration in this context is a C++23 extension}} case 0: break; } - if(using foo = int; false) {} //expected-cxx20-warning {{alias declaration in this context is a C++2b extension}} + if(using foo = int; false) {} //expected-cxx20-warning {{alias declaration in this context is a C++23 extension}} if (using enum ns::e; false){} // expected-error {{expected '='}} diff --git a/clang/test/Parser/cxx2b-label.cpp b/clang/test/Parser/cxx2b-label.cpp --- a/clang/test/Parser/cxx2b-label.cpp +++ b/clang/test/Parser/cxx2b-label.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fsyntax-only -verify=expected,cxx2b -std=c++2b -Wpre-c++2b-compat %s +// RUN: %clang_cc1 -fsyntax-only -verify=expected,cxx23 -std=c++23 -Wpre-c++23-compat %s // RUN: %clang_cc1 -fsyntax-only -verify=expected,cxx20 -std=c++20 %s void test_label_in_func() { @@ -7,8 +7,8 @@ label2: x = 1; label3: label4: label5: -} // cxx20-warning {{label at end of compound statement is a C++2b extension}} \ - cxx2b-warning {{label at end of compound statement is incompatible with C++ standards before C++2b}} +} // cxx20-warning {{label at end of compound statement is a C++23 extension}} \ + cxx23-warning {{label at end of compound statement is incompatible with C++ standards before C++23}} int test_label_in_switch(int v) { switch (v) { @@ -17,15 +17,15 @@ case 2: return 2; case 3: case 4: case 5: - } // cxx20-warning {{label at end of compound statement is a C++2b extension}} \ - cxx2b-warning {{label at end of compound statement is incompatible with C++ standards before C++2b}} + } // cxx20-warning {{label at end of compound statement is a C++23 extension}} \ + cxx23-warning {{label at end of compound statement is incompatible with C++ standards before C++23}} switch (v) { case 6: return 6; default: - } // cxx20-warning {{label at end of compound statement is a C++2b extension}} \ - cxx2b-warning {{label at end of compound statement is incompatible with C++ standards before C++2b}} + } // cxx20-warning {{label at end of compound statement is a C++23 extension}} \ + cxx23-warning {{label at end of compound statement is incompatible with C++ standards before C++23}} return 0; } diff --git a/clang/test/Parser/cxx2b-lambdas-ext-warns.cpp b/clang/test/Parser/cxx2b-lambdas-ext-warns.cpp --- a/clang/test/Parser/cxx2b-lambdas-ext-warns.cpp +++ b/clang/test/Parser/cxx2b-lambdas-ext-warns.cpp @@ -1,16 +1,16 @@ // RUN: %clang_cc1 -std=c++20 %s -verify=cxx20 -// RUN: %clang_cc1 -std=c++2b %s -verify=cxx2b -// RUN: %clang_cc1 -std=c++2b -Wpre-c++2b-compat %s -verify=precxx2b -// RUN: %clang_cc1 -std=c++2b -pedantic %s -verify=cxx2b +// RUN: %clang_cc1 -std=c++23 %s -verify=cxx23 +// RUN: %clang_cc1 -std=c++23 -Wpre-c++23-compat %s -verify=precxx23 +// RUN: %clang_cc1 -std=c++23 -pedantic %s -verify=cxx23 -//cxx2b-no-diagnostics +//cxx23-no-diagnostics auto L1 = [] constexpr {}; -// cxx20-warning@-1 {{lambda without a parameter clause is a C++2b extension}} +// cxx20-warning@-1 {{lambda without a parameter clause is a C++23 extension}} auto L2 = []() static {}; -// cxx20-warning@-1 {{static lambdas are a C++2b extension}} -// precxx2b-warning@-2 {{static lambdas are incompatible with C++ standards before C++2b}} +// cxx20-warning@-1 {{static lambdas are a C++23 extension}} +// precxx23-warning@-2 {{static lambdas are incompatible with C++ standards before C++23}} auto L3 = [] static {}; -// cxx20-warning@-1 {{lambda without a parameter clause is a C++2b extension}} -// cxx20-warning@-2 {{static lambdas are a C++2b extension}} -// precxx2b-warning@-3 {{static lambdas are incompatible with C++ standards before C++2b}} +// cxx20-warning@-1 {{lambda without a parameter clause is a C++23 extension}} +// cxx20-warning@-2 {{static lambdas are a C++23 extension}} +// precxx23-warning@-3 {{static lambdas are incompatible with C++ standards before C++23}} diff --git a/clang/test/Parser/cxx2b-lambdas.cpp b/clang/test/Parser/cxx2b-lambdas.cpp --- a/clang/test/Parser/cxx2b-lambdas.cpp +++ b/clang/test/Parser/cxx2b-lambdas.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -std=c++2b %s -verify +// RUN: %clang_cc1 -std=c++23 %s -verify auto LL0 = [] {}; auto LL1 = []() {}; diff --git a/clang/test/Parser/cxx2b-subscript.cpp b/clang/test/Parser/cxx2b-subscript.cpp --- a/clang/test/Parser/cxx2b-subscript.cpp +++ b/clang/test/Parser/cxx2b-subscript.cpp @@ -1,34 +1,34 @@ -// RUN: %clang_cc1 -fsyntax-only -verify=expected,cxx2b -std=c++2b %s +// RUN: %clang_cc1 -fsyntax-only -verify=expected,cxx23 -std=c++23 %s // RUN: %clang_cc1 -fsyntax-only -verify=expected,cxx20 -std=c++20 %s -//cxx2b-no-diagnostics +//cxx23-no-diagnostics struct S { constexpr int operator[](int i) { return i; } - constexpr int operator[](int a, int b) { // cxx20-error {{overloaded 'operator[]' cannot have more than one parameter before C++2b}} + constexpr int operator[](int a, int b) { // cxx20-error {{overloaded 'operator[]' cannot have more than one parameter before C++23}} return a + b; } - constexpr int operator[]() { // cxx20-error {{overloaded 'operator[]' cannot have no parameter before C++2b}} + constexpr int operator[]() { // cxx20-error {{overloaded 'operator[]' cannot have no parameter before C++23}} return 42; } }; struct Defaults { - constexpr int operator[](int i = 0) { // cxx20-error {{overloaded 'operator[]' cannot have a defaulted parameter before C++2b}} + constexpr int operator[](int i = 0) { // cxx20-error {{overloaded 'operator[]' cannot have a defaulted parameter before C++23}} return 0; } - constexpr int operator[](int a, int b, int c = 0) { // cxx20-error {{overloaded 'operator[]' cannot have a defaulted parameter before C++2b}}\ - // cxx20-error {{cannot have more than one parameter before C++2b}} + constexpr int operator[](int a, int b, int c = 0) { // cxx20-error {{overloaded 'operator[]' cannot have a defaulted parameter before C++23}}\ + // cxx20-error {{cannot have more than one parameter before C++23}} return 0; } }; template struct T1 { - constexpr auto operator[](T &&...arg); // cxx20-error {{overloaded 'operator[]' cannot have no parameter before C++2b}} \ - // cxx20-error {{overloaded 'operator[]' cannot have more than one parameter before C++2b}} + constexpr auto operator[](T &&...arg); // cxx20-error {{overloaded 'operator[]' cannot have no parameter before C++23}} \ + // cxx20-error {{overloaded 'operator[]' cannot have more than one parameter before C++23}} }; T1<> t10; // cxx20-note {{requested here}} @@ -43,16 +43,16 @@ S s; (void)s[0]; (void)s[1, 2]; // cxx20-warning {{left operand of comma operator has no effect}}\ - // cxx20-warning {{top-level comma expression in array subscript is deprecated in C++20 and unsupported in C++2b}} + // cxx20-warning {{top-level comma expression in array subscript is deprecated in C++20 and unsupported in C++23}} (void)S{}[]; // cxx20-error {{expected expression}} (void)Defaults{}[1]; (void)Defaults{}[]; // cxx20-error {{expected expression}} (void)Defaults{}[1, 2]; // cxx20-warning {{left operand of comma operator has no effect}}\ - // cxx20-warning {{top-level comma expression in array subscript is deprecated in C++20 and unsupported in C++2b}} + // cxx20-warning {{top-level comma expression in array subscript is deprecated in C++20 and unsupported in C++23}} Variadic{}[]; // cxx20-error {{expected expression}} Variadic{}[1]; Variadic{}[1, 2]; // cxx20-warning {{left operand of comma operator has no effect}}\ - // cxx20-warning {{top-level comma expression in array subscript is deprecated in C++20 and unsupported in C++2b}} + // cxx20-warning {{top-level comma expression in array subscript is deprecated in C++20 and unsupported in C++23}} } diff --git a/clang/test/Parser/switch-recovery.cpp b/clang/test/Parser/switch-recovery.cpp --- a/clang/test/Parser/switch-recovery.cpp +++ b/clang/test/Parser/switch-recovery.cpp @@ -161,14 +161,14 @@ switch (x) { case 1: case 0: - } // expected-warning {{label at end of compound statement is a C++2b extension}} + } // expected-warning {{label at end of compound statement is a C++23 extension}} } void missing_statement_default(int x) { switch (x) { case 0: default: - } // expected-warning {{label at end of compound statement is a C++2b extension}} + } // expected-warning {{label at end of compound statement is a C++23 extension}} } void pr19022_1() { @@ -179,7 +179,7 @@ void pr19022_1a(int x) { switch(x) { case 1 // expected-error{{expected ':' after 'case'}} - } // expected-warning {{label at end of compound statement is a C++2b extension}} + } // expected-warning {{label at end of compound statement is a C++23 extension}} } void pr19022_1b(int x) { @@ -211,7 +211,7 @@ switch(x) { case 1: case // expected-error{{expected ':' after 'case'}} } // expected-error{{expected expression}} \ - // expected-warning {{label at end of compound statement is a C++2b extension}} + // expected-warning {{label at end of compound statement is a C++23 extension}} } namespace pr19022 { diff --git a/clang/test/Preprocessor/ext-pp-directive.c b/clang/test/Preprocessor/ext-pp-directive.c --- a/clang/test/Preprocessor/ext-pp-directive.c +++ b/clang/test/Preprocessor/ext-pp-directive.c @@ -6,11 +6,11 @@ // RUN: not %clang_cc1 -std=c2x -fsyntax-only -verify %s // For C++ -// RUN: %clang_cc1 -x c++ -fsyntax-only -verify=pre-cpp2b-pedantic -pedantic %s -// RUN: %clang_cc1 -x c++ -std=c++2b -fsyntax-only -verify=pre-cpp2b-compat -Wpre-c++2b-compat %s +// RUN: %clang_cc1 -x c++ -fsyntax-only -verify=pre-cpp23-pedantic -pedantic %s +// RUN: %clang_cc1 -x c++ -std=c++23 -fsyntax-only -verify=pre-cpp23-compat -Wpre-c++23-compat %s // RUN: not %clang_cc1 -x c++ -fsyntax-only -verify %s -// RUN: not %clang_cc1 -x c++ -std=c++2b -fsyntax-only -verify -pedantic %s -// RUN: not %clang_cc1 -x c++ -std=c++2b -fsyntax-only -verify %s +// RUN: not %clang_cc1 -x c++ -std=c++23 -fsyntax-only -verify -pedantic %s +// RUN: not %clang_cc1 -x c++ -std=c++23 -fsyntax-only -verify %s int x; @@ -22,8 +22,8 @@ // pre-c2x-compat-warning@#1 {{use of a '#elifdef' directive is incompatible with C standards before C2x}} // For C++ -// pre-cpp2b-pedantic-warning@#1 {{use of a '#elifdef' directive is a C++2b extension}} -// pre-cpp2b-compat-warning@#1 {{use of a '#elifdef' directive is incompatible with C++ standards before C++2b}} +// pre-cpp23-pedantic-warning@#1 {{use of a '#elifdef' directive is a C++23 extension}} +// pre-cpp23-compat-warning@#1 {{use of a '#elifdef' directive is incompatible with C++ standards before C++23}} #if 1 #elifndef B // #2 @@ -33,8 +33,8 @@ // pre-c2x-compat-warning@#2 {{use of a '#elifndef' directive is incompatible with C standards before C2x}} // For C++ -// pre-cpp2b-pedantic-warning@#2 {{use of a '#elifndef' directive is a C++2b extension}} -// pre-cpp2b-compat-warning@#2 {{use of a '#elifndef' directive is incompatible with C++ standards before C++2b}} +// pre-cpp23-pedantic-warning@#2 {{use of a '#elifndef' directive is a C++23 extension}} +// pre-cpp23-compat-warning@#2 {{use of a '#elifndef' directive is incompatible with C++ standards before C++23}} #if 0 #elifdef C @@ -44,8 +44,8 @@ // pre-c2x-compat-warning@-4 {{use of a '#elifdef' directive is incompatible with C standards before C2x}} // For C++ -// pre-cpp2b-pedantic-warning@-7 {{use of a '#elifdef' directive is a C++2b extension}} -// pre-cpp2b-compat-warning@-8 {{use of a '#elifdef' directive is incompatible with C++ standards before C++2b}} +// pre-cpp23-pedantic-warning@-7 {{use of a '#elifdef' directive is a C++23 extension}} +// pre-cpp23-compat-warning@-8 {{use of a '#elifdef' directive is incompatible with C++ standards before C++23}} #if 0 #elifndef D @@ -55,8 +55,8 @@ // pre-c2x-compat-warning@-4 {{use of a '#elifndef' directive is incompatible with C standards before C2x}} // For C++ -// pre-cpp2b-pedantic-warning@-7 {{use of a '#elifndef' directive is a C++2b extension}} -// pre-cpp2b-compat-warning@-8 {{use of a '#elifndef' directive is incompatible with C++ standards before C++2b}} +// pre-cpp23-pedantic-warning@-7 {{use of a '#elifndef' directive is a C++23 extension}} +// pre-cpp23-compat-warning@-8 {{use of a '#elifndef' directive is incompatible with C++ standards before C++23}} #warning foo // For C @@ -66,7 +66,7 @@ // pre-c2x-compat-warning@-5 {{foo}} // For C++ -// pre-cpp2b-pedantic-warning@-8 {{#warning is a C++2b extension}} -// pre-cpp2b-pedantic-warning@-9 {{foo}} -// pre-cpp2b-compat-warning@-10 {{#warning is incompatible with C++ standards before C++2b}} -// pre-cpp2b-compat-warning@-11 {{foo}} +// pre-cpp23-pedantic-warning@-8 {{#warning is a C++23 extension}} +// pre-cpp23-pedantic-warning@-9 {{foo}} +// pre-cpp23-compat-warning@-10 {{#warning is incompatible with C++ standards before C++23}} +// pre-cpp23-compat-warning@-11 {{foo}} diff --git a/clang/test/Preprocessor/init.c b/clang/test/Preprocessor/init.c --- a/clang/test/Preprocessor/init.c +++ b/clang/test/Preprocessor/init.c @@ -9,7 +9,7 @@ // BLOCKS:#define __block __attribute__((__blocks__(byref))) // // -// RUN: %clang_cc1 -x c++ -fgnuc-version=4.2.1 -std=c++2b -E -dM < /dev/null | FileCheck -match-full-lines -check-prefix CXX2B %s +// RUN: %clang_cc1 -x c++ -fgnuc-version=4.2.1 -std=c++23 -E -dM < /dev/null | FileCheck -match-full-lines -check-prefix CXX2B %s // // CXX2B:#define __GNUG__ 4 // CXX2B:#define __GXX_EXPERIMENTAL_CXX0X__ 1 @@ -133,7 +133,7 @@ // RUN: %clang_cc1 -ffreestanding -E -dM < /dev/null | FileCheck -match-full-lines -check-prefix FREESTANDING %s // FREESTANDING:#define __STDC_HOSTED__ 0 // -// RUN: %clang_cc1 -x c++ -fgnuc-version=4.2.1 -std=gnu++2b -E -dM < /dev/null | FileCheck -match-full-lines -check-prefix GXX2B %s +// RUN: %clang_cc1 -x c++ -fgnuc-version=4.2.1 -std=gnu++23 -E -dM < /dev/null | FileCheck -match-full-lines -check-prefix GXX2B %s // // GXX2B:#define __GNUG__ 4 // GXX2B:#define __GXX_WEAK__ 1 diff --git a/clang/test/Preprocessor/macro_vaopt_check.cpp b/clang/test/Preprocessor/macro_vaopt_check.cpp --- a/clang/test/Preprocessor/macro_vaopt_check.cpp +++ b/clang/test/Preprocessor/macro_vaopt_check.cpp @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 %s -Eonly -verify -Wno-all -Wno-c++2b-extensions -pedantic -std=c++20 -// RUN: %clang_cc1 %s -Eonly -verify -Wno-all -Wno-c++2b-extensions -pedantic -std=c++11 +// RUN: %clang_cc1 %s -Eonly -verify -Wno-all -Wno-c++23-extensions -pedantic -std=c++20 +// RUN: %clang_cc1 %s -Eonly -verify -Wno-all -Wno-c++23-extensions -pedantic -std=c++11 // RUN: %clang_cc1 -x c %s -Eonly -verify -Wno-all -Wno-c2x-extensions -pedantic -std=c99 //expected-error@+1{{missing '('}} diff --git a/clang/test/Preprocessor/predefined-win-macros.c b/clang/test/Preprocessor/predefined-win-macros.c --- a/clang/test/Preprocessor/predefined-win-macros.c +++ b/clang/test/Preprocessor/predefined-win-macros.c @@ -52,7 +52,7 @@ // CHECK-MS-CPP20: #define _MSVC_LANG 202002L // RUN: %clang_cc1 %s -x c++ -E -dM -triple i686-pc-win32 -fms-extensions -fms-compatibility \ -// RUN: -fms-compatibility-version=19.00 -std=c++2b -o - | FileCheck -match-full-lines %s --check-prefix=CHECK-MS-CPP2B +// RUN: -fms-compatibility-version=19.00 -std=c++23 -o - | FileCheck -match-full-lines %s --check-prefix=CHECK-MS-CPP2B // CHECK-MS-CPP2B: #define _MSC_VER 1900 // CHECK-MS-CPP2B: #define _MSVC_LANG 202004L diff --git a/clang/test/Preprocessor/suggest-typoed-directive.c b/clang/test/Preprocessor/suggest-typoed-directive.c --- a/clang/test/Preprocessor/suggest-typoed-directive.c +++ b/clang/test/Preprocessor/suggest-typoed-directive.c @@ -1,19 +1,19 @@ -// RUN: %clang_cc1 -fsyntax-only -verify=pre-c2x-cpp2b %s -// RUN: %clang_cc1 -std=c2x -fsyntax-only -verify=c2x-cpp2b %s -// RUN: %clang_cc1 -x c++ -std=c++2b -fsyntax-only -verify=c2x-cpp2b %s -// RUN: %clang_cc1 -x c++ -std=c++2b -fsyntax-only %s -fdiagnostics-parseable-fixits 2>&1 | FileCheck %s +// RUN: %clang_cc1 -fsyntax-only -verify=pre-c2x-cpp23 %s +// RUN: %clang_cc1 -std=c2x -fsyntax-only -verify=c2x-cpp23 %s +// RUN: %clang_cc1 -x c++ -std=c++23 -fsyntax-only -verify=c2x-cpp23 %s +// RUN: %clang_cc1 -x c++ -std=c++23 -fsyntax-only %s -fdiagnostics-parseable-fixits 2>&1 | FileCheck %s -// id: pre-c2x-cpp2b-warning@+12 {{invalid preprocessing directive, did you mean '#if'?}} -// ifd: pre-c2x-cpp2b-warning@+12 {{invalid preprocessing directive, did you mean '#if'?}} -// ifde: pre-c2x-cpp2b-warning@+12 {{invalid preprocessing directive, did you mean '#ifdef'?}} -// elf: pre-c2x-cpp2b-warning@+12 {{invalid preprocessing directive, did you mean '#elif'?}} -// elsif: pre-c2x-cpp2b-warning@+12 {{invalid preprocessing directive, did you mean '#elif'?}} -// elseif: pre-c2x-cpp2b-warning@+12 {{invalid preprocessing directive, did you mean '#elif'?}} +// id: pre-c2x-cpp23-warning@+12 {{invalid preprocessing directive, did you mean '#if'?}} +// ifd: pre-c2x-cpp23-warning@+12 {{invalid preprocessing directive, did you mean '#if'?}} +// ifde: pre-c2x-cpp23-warning@+12 {{invalid preprocessing directive, did you mean '#ifdef'?}} +// elf: pre-c2x-cpp23-warning@+12 {{invalid preprocessing directive, did you mean '#elif'?}} +// elsif: pre-c2x-cpp23-warning@+12 {{invalid preprocessing directive, did you mean '#elif'?}} +// elseif: pre-c2x-cpp23-warning@+12 {{invalid preprocessing directive, did you mean '#elif'?}} // elfidef: not suggested to '#elifdef' // elfindef: not suggested to '#elifdef' // elfinndef: not suggested to '#elifndef' -// els: pre-c2x-cpp2b-warning@+12 {{invalid preprocessing directive, did you mean '#else'?}} -// endi: pre-c2x-cpp2b-warning@+12 {{invalid preprocessing directive, did you mean '#endif'?}} +// els: pre-c2x-cpp23-warning@+12 {{invalid preprocessing directive, did you mean '#else'?}} +// endi: pre-c2x-cpp23-warning@+12 {{invalid preprocessing directive, did you mean '#endif'?}} #ifdef UNDEFINED #id #ifd @@ -27,17 +27,17 @@ #els #endi #endif -// id: c2x-cpp2b-warning@-12 {{invalid preprocessing directive, did you mean '#if'?}} -// ifd: c2x-cpp2b-warning@-12 {{invalid preprocessing directive, did you mean '#if'?}} -// ifde: c2x-cpp2b-warning@-12 {{invalid preprocessing directive, did you mean '#ifdef'?}} -// elf: c2x-cpp2b-warning@-12 {{invalid preprocessing directive, did you mean '#elif'?}} -// elsif: c2x-cpp2b-warning@-12 {{invalid preprocessing directive, did you mean '#elif'?}} -// elseif: c2x-cpp2b-warning@-12 {{invalid preprocessing directive, did you mean '#elif'?}} -// elfidef: c2x-cpp2b-warning@-12 {{invalid preprocessing directive, did you mean '#elifdef'?}} -// elfindef: c2x-cpp2b-warning@-12 {{invalid preprocessing directive, did you mean '#elifdef'?}} -// elfinndef: c2x-cpp2b-warning@-12 {{invalid preprocessing directive, did you mean '#elifndef'?}} -// els: c2x-cpp2b-warning@-12 {{invalid preprocessing directive, did you mean '#else'?}} -// endi: c2x-cpp2b-warning@-12 {{invalid preprocessing directive, did you mean '#endif'?}} +// id: c2x-cpp23-warning@-12 {{invalid preprocessing directive, did you mean '#if'?}} +// ifd: c2x-cpp23-warning@-12 {{invalid preprocessing directive, did you mean '#if'?}} +// ifde: c2x-cpp23-warning@-12 {{invalid preprocessing directive, did you mean '#ifdef'?}} +// elf: c2x-cpp23-warning@-12 {{invalid preprocessing directive, did you mean '#elif'?}} +// elsif: c2x-cpp23-warning@-12 {{invalid preprocessing directive, did you mean '#elif'?}} +// elseif: c2x-cpp23-warning@-12 {{invalid preprocessing directive, did you mean '#elif'?}} +// elfidef: c2x-cpp23-warning@-12 {{invalid preprocessing directive, did you mean '#elifdef'?}} +// elfindef: c2x-cpp23-warning@-12 {{invalid preprocessing directive, did you mean '#elifdef'?}} +// elfinndef: c2x-cpp23-warning@-12 {{invalid preprocessing directive, did you mean '#elifndef'?}} +// els: c2x-cpp23-warning@-12 {{invalid preprocessing directive, did you mean '#else'?}} +// endi: c2x-cpp23-warning@-12 {{invalid preprocessing directive, did you mean '#endif'?}} // CHECK: fix-it:{{.*}}:{[[@LINE-24]]:2-[[@LINE-24]]:4}:"if" // CHECK: fix-it:{{.*}}:{[[@LINE-24]]:2-[[@LINE-24]]:5}:"if" diff --git a/clang/test/Preprocessor/ucn-pp-identifier.c b/clang/test/Preprocessor/ucn-pp-identifier.c --- a/clang/test/Preprocessor/ucn-pp-identifier.c +++ b/clang/test/Preprocessor/ucn-pp-identifier.c @@ -1,6 +1,6 @@ // RUN: %clang_cc1 %s -fsyntax-only -std=c99 -pedantic -verify=expected,ext -Wundef -DTRIGRAPHS=1 // RUN: %clang_cc1 %s -fsyntax-only -x c++ -pedantic -verify=expected,ext -Wundef -fno-trigraphs -// RUN: %clang_cc1 %s -fsyntax-only -x c++ -std=c++2b -pedantic -ftrigraphs -DTRIGRAPHS=1 -verify=expected,cxx2b -Wundef -Wpre-c++2b-compat +// RUN: %clang_cc1 %s -fsyntax-only -x c++ -std=c++23 -pedantic -ftrigraphs -DTRIGRAPHS=1 -verify=expected,cxx23 -Wundef -Wpre-c++23-compat // RUN: %clang_cc1 %s -fsyntax-only -x c++ -pedantic -verify=expected,ext -Wundef -ftrigraphs -DTRIGRAPHS=1 // RUN: not %clang_cc1 %s -fsyntax-only -std=c99 -pedantic -Wundef 2>&1 | FileCheck -strict-whitespace %s @@ -18,7 +18,7 @@ #error "This should never happen" #endif -#if a\u{FD}() // ext-warning {{extension}} cxx2b-warning {{before C++2b}} +#if a\u{FD}() // ext-warning {{extension}} cxx23-warning {{before C++23}} #error "This should never happen" #endif @@ -34,12 +34,12 @@ #define \U10000000 // expected-error {{macro name must be an identifier}} #define \u0061 // expected-error {{character 'a' cannot be specified by a universal character name}} expected-error {{macro name must be an identifier}} #define \u{fffe} // expected-error {{macro name must be an identifier}} \ - // ext-warning {{extension}} cxx2b-warning {{before C++2b}} + // ext-warning {{extension}} cxx23-warning {{before C++23}} #define \N{ALERT} // expected-error {{universal character name refers to a control character}} \ // expected-error {{macro name must be an identifier}} \ - // ext-warning {{extension}} cxx2b-warning {{before C++2b}} + // ext-warning {{extension}} cxx23-warning {{before C++23}} #define \N{WASTEBASKET} // expected-error {{macro name must be an identifier}} \ - // ext-warning {{extension}} cxx2b-warning {{before C++2b}} + // ext-warning {{extension}} cxx23-warning {{before C++23}} #define a\u0024 #if \u0110 // expected-warning {{is not defined, evaluates to 0}} @@ -141,10 +141,10 @@ int \N{\ LATIN CAPITAL LETTER A WITH GRAVE}; -//ext-warning@-2 {{extension}} cxx2b-warning@-2 {{before C++2b}} +//ext-warning@-2 {{extension}} cxx23-warning@-2 {{before C++23}} #ifdef TRIGRAPHS -int \N?? = 0; // cxx2b-warning {{before C++2b}} \ +int \N?? = 0; // cxx23-warning {{before C++23}} \ //ext-warning {{extension}}\ // expected-warning 2{{trigraph converted}} diff --git a/clang/test/Sema/gnu-asm-pmf.cpp b/clang/test/Sema/gnu-asm-pmf.cpp --- a/clang/test/Sema/gnu-asm-pmf.cpp +++ b/clang/test/Sema/gnu-asm-pmf.cpp @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -triple x86_64-unknown-windows-msvc -std=c++2b -fsyntax-only %s -verify -// RUN: %clang_cc1 -triple x86_64-unknown-windows-itanium -std=c++2b -fsyntax-only %s -verify +// RUN: %clang_cc1 -triple x86_64-unknown-windows-msvc -std=c++23 -fsyntax-only %s -verify +// RUN: %clang_cc1 -triple x86_64-unknown-windows-itanium -std=c++23 -fsyntax-only %s -verify struct S { void operator()(); diff --git a/clang/test/Sema/stmtexpr-init.c b/clang/test/Sema/stmtexpr-init.c --- a/clang/test/Sema/stmtexpr-init.c +++ b/clang/test/Sema/stmtexpr-init.c @@ -6,7 +6,7 @@ int *x[1] = {({ static int _x = 10; &_x; })}; // expected-no-error /* Before commit - 683e83c5 [Clang][C++2b] P2242R3: Non-literal variables [...] in constexpr + 683e83c5 [Clang][C++23] P2242R3: Non-literal variables [...] in constexpr (i.e in clang-14 and earlier) this was silently accepted, but generated incorrect code. */ diff --git a/clang/test/SemaCXX/P1155.cpp b/clang/test/SemaCXX/P1155.cpp --- a/clang/test/SemaCXX/P1155.cpp +++ b/clang/test/SemaCXX/P1155.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -std=c++2b -fsyntax-only -fcxx-exceptions -verify %s +// RUN: %clang_cc1 -std=c++23 -fsyntax-only -fcxx-exceptions -verify %s // RUN: %clang_cc1 -std=c++20 -fsyntax-only -fcxx-exceptions -verify %s // RUN: %clang_cc1 -std=c++11 -fsyntax-only -fcxx-exceptions -verify %s // expected-no-diagnostics diff --git a/clang/test/SemaCXX/constant-expression-cxx11.cpp b/clang/test/SemaCXX/constant-expression-cxx11.cpp --- a/clang/test/SemaCXX/constant-expression-cxx11.cpp +++ b/clang/test/SemaCXX/constant-expression-cxx11.cpp @@ -1,12 +1,12 @@ -// RUN: %clang_cc1 -std=c++2b -fsyntax-only -verify=expected,cxx20_2b,cxx2b -triple x86_64-linux -Wno-string-plus-int -Wno-pointer-arith -Wno-zero-length-array -Wno-c99-designator -fcxx-exceptions -pedantic %s -Wno-comment -Wno-tautological-pointer-compare -Wno-bool-conversion -// RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify=expected,cxx11_20,cxx20_2b -triple x86_64-linux -Wno-string-plus-int -Wno-pointer-arith -Wno-zero-length-array -Wno-c99-designator -fcxx-exceptions -pedantic %s -Wno-comment -Wno-tautological-pointer-compare -Wno-bool-conversion +// RUN: %clang_cc1 -std=c++23 -fsyntax-only -verify=expected,cxx20_23,cxx23 -triple x86_64-linux -Wno-string-plus-int -Wno-pointer-arith -Wno-zero-length-array -Wno-c99-designator -fcxx-exceptions -pedantic %s -Wno-comment -Wno-tautological-pointer-compare -Wno-bool-conversion +// RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify=expected,cxx11_20,cxx20_23 -triple x86_64-linux -Wno-string-plus-int -Wno-pointer-arith -Wno-zero-length-array -Wno-c99-designator -fcxx-exceptions -pedantic %s -Wno-comment -Wno-tautological-pointer-compare -Wno-bool-conversion // RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify=expected,cxx11_20,cxx11 -triple x86_64-linux -Wno-string-plus-int -Wno-pointer-arith -Wno-zero-length-array -Wno-c99-designator -fcxx-exceptions -pedantic %s -Wno-comment -Wno-tautological-pointer-compare -Wno-bool-conversion namespace StaticAssertFoldTest { int x; static_assert(++x, "test"); // expected-error {{not an integral constant expression}} -// cxx20_2b-note@-1 {{cannot modify an object that is visible outside that expression}} +// cxx20_23-note@-1 {{cannot modify an object that is visible outside that expression}} static_assert(false, "test"); // expected-error {{test}} } @@ -360,7 +360,7 @@ constexpr bool constaddress = (void *)externalvar == (void *)0x4000UL; // expected-error {{must be initialized by a constant expression}} expected-note {{reinterpret_cast}} constexpr bool litaddress = "foo" == "foo"; // expected-error {{must be initialized by a constant expression}} // expected-note@-1 {{comparison of addresses of literals has unspecified value}} -// cxx20_2b-warning@-2 {{comparison between two arrays is deprecated}} +// cxx20_23-warning@-2 {{comparison between two arrays is deprecated}} static_assert(0 != "foo", ""); } @@ -1777,12 +1777,12 @@ namespace TypeId { struct A { virtual ~A(); }; A f(); - A &g(); // cxx20_2b-note {{declared here}} + A &g(); // cxx20_23-note {{declared here}} constexpr auto &x = typeid(f()); constexpr auto &y = typeid(g()); // expected-error{{constant expression}} // cxx11-note@-1 {{typeid applied to expression of polymorphic type 'A' is not allowed in a constant expression}} // expected-warning@-2 {{expression with side effects will be evaluated despite being used as an operand to 'typeid'}} - // cxx20_2b-note@-3 {{non-constexpr function 'g' cannot be used in a constant expression}} + // cxx20_23-note@-3 {{non-constexpr function 'g' cannot be used in a constant expression}} } namespace PR14203 { @@ -1921,14 +1921,14 @@ static_assert(p->f() == sizeof(X), ""); // cxx11-error@-1 {{not an integral constant expression}} // cxx11-note@-2 {{call to virtual function}} - // cxx20_2b-error@-3 {{static assertion failed}} - // cxx20_2b-note@-4 {{8 == 16}} + // cxx20_23-error@-3 {{static assertion failed}} + // cxx20_23-note@-4 {{8 == 16}} // Non-virtual f(), OK. constexpr X> xxs2; constexpr X *q = const_cast>*>(&xxs2); - static_assert(q->f() == sizeof(S2), ""); // cxx20_2b-error {{static assertion failed}} \ - // cxx20_2b-note {{16 == 8}} + static_assert(q->f() == sizeof(S2), ""); // cxx20_23-error {{static assertion failed}} \ + // cxx20_23-note {{16 == 8}} } namespace ConstexprConstructorRecovery { @@ -1954,7 +1954,7 @@ } constexpr int &get(int &&n) { return n; } - // cxx2b-error@-1 {{non-const lvalue reference to type 'int' cannot bind to a temporary of type 'int'}} + // cxx23-error@-1 {{non-const lvalue reference to type 'int' cannot bind to a temporary of type 'int'}} constexpr int &&get_rv(int &&n) { return static_cast(n); } struct S { int &&r; @@ -2281,13 +2281,13 @@ constexpr D d(0); // cxx11-error {{constant expression}} cxx11-note {{derived class}} struct E : virtual A { using A::A; }; // expected-note {{here}} - // cxx20_2b-note@-1 {{struct with virtual base class is not a literal type}} + // cxx20_23-note@-1 {{struct with virtual base class is not a literal type}} // We wrap a function around this to avoid implicit zero-initialization // happening first; the zero-initialization step would produce the same // error and defeat the point of this test. void f() { constexpr E e(0); // cxx11-error {{constant expression}} cxx11-note {{derived class}} - // cxx20_2b-error@-1 {{constexpr variable cannot have non-literal type}} + // cxx20_23-error@-1 {{constexpr variable cannot have non-literal type}} } // FIXME: This produces a note with no source location. //constexpr E e(0); diff --git a/clang/test/SemaCXX/constant-expression-cxx14.cpp b/clang/test/SemaCXX/constant-expression-cxx14.cpp --- a/clang/test/SemaCXX/constant-expression-cxx14.cpp +++ b/clang/test/SemaCXX/constant-expression-cxx14.cpp @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -std=c++2b -fsyntax-only -verify=expected,cxx20_2b,cxx2b %s -fcxx-exceptions -triple=x86_64-linux-gnu -// RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify=expected,cxx14_20,cxx20_2b,cxx20 %s -fcxx-exceptions -triple=x86_64-linux-gnu +// RUN: %clang_cc1 -std=c++23 -fsyntax-only -verify=expected,cxx20_23,cxx23 %s -fcxx-exceptions -triple=x86_64-linux-gnu +// RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify=expected,cxx14_20,cxx20_23,cxx20 %s -fcxx-exceptions -triple=x86_64-linux-gnu // RUN: %clang_cc1 -std=c++14 -fsyntax-only -verify=expected,cxx14_20,cxx14 %s -fcxx-exceptions -triple=x86_64-linux-gnu struct S { @@ -46,12 +46,12 @@ static_assert(g(2) == 42, ""); constexpr int h(int n) { // expected-error {{constexpr function never produces a constant expression}} static const int m = n; // expected-note {{control flows through the definition of a static variable}} \ - // cxx14_20-warning {{definition of a static variable in a constexpr function is a C++2b extension}} + // cxx14_20-warning {{definition of a static variable in a constexpr function is a C++23 extension}} return m; } constexpr int i(int n) { // expected-error {{constexpr function never produces a constant expression}} thread_local const int m = n; // expected-note {{control flows through the definition of a thread_local variable}} \ - // cxx14_20-warning {{definition of a thread_local variable in a constexpr function is a C++2b extension}} + // cxx14_20-warning {{definition of a thread_local variable in a constexpr function is a C++23 extension}} return m; } @@ -229,7 +229,7 @@ // expected-note@-2 {{assignment to member 'c' of union with active member 'n'}} } constexpr bool check(D &d) { return d.c.a.y == 3; } - // cxx20_2b-note@-1 {{read of member 'y' of union with active member 'x'}} + // cxx20_23-note@-1 {{read of member 'y' of union with active member 'x'}} constexpr bool g() { D d; f(d); return d.c.a.y == 3; } static_assert(g(), ""); @@ -242,7 +242,7 @@ static_assert(i(), ""); // expected-error {{constant expression}} expected-note {{in call}} constexpr bool j() { D d; d.c.a.x = 3; return check(d); } // cxx14-note {{assignment to member 'x' of union with active member 'y'}} - // cxx20_2b-note@-1 {{in call to 'check(d)'}} + // cxx20_23-note@-1 {{in call to 'check(d)'}} static_assert(j(), ""); // expected-error {{constant expression}} expected-note {{in call}} } @@ -271,12 +271,12 @@ namespace incdec { template constexpr T &ref(T &&r) { return r; } - // cxx2b-error@-1 {{non-const lvalue reference to type 'int' cannot bind to a temporary of type 'int'}} + // cxx23-error@-1 {{non-const lvalue reference to type 'int' cannot bind to a temporary of type 'int'}} template constexpr T postinc(T &&r) { return (r++, r); } template constexpr T postdec(T &&r) { return (r--, r); } template int &ref(int &&); - // cxx2b-note@-1 {{in instantiation of function template specialization}} + // cxx23-note@-1 {{in instantiation of function template specialization}} static_assert(postinc(0) == 1, ""); static_assert(postdec(0) == -1, ""); @@ -345,7 +345,7 @@ } constexpr int wrong_member = f({0}); // expected-error {{constant}} expected-note {{in call to 'f({.a = 0})'}} constexpr int vol = --ref(0); // expected-error {{constant}} expected-note {{decrement of volatile-qualified}} - // cxx20_2b-warning@-1 {{decrement of object of volatile-qualified type 'volatile int' is deprecated}} + // cxx20_23-warning@-1 {{decrement of object of volatile-qualified type 'volatile int' is deprecated}} constexpr int incr(int k) { int x = k; @@ -877,7 +877,7 @@ namespace Lifetime { constexpr int &get(int &&r) { return r; } - // cxx2b-error@-1 {{non-const lvalue reference to type 'int' cannot bind to a temporary of type 'int'}} + // cxx23-error@-1 {{non-const lvalue reference to type 'int' cannot bind to a temporary of type 'int'}} constexpr int f() { int &r = get(123); return r; diff --git a/clang/test/SemaCXX/constant-expression-cxx2b.cpp b/clang/test/SemaCXX/constant-expression-cxx2b.cpp --- a/clang/test/SemaCXX/constant-expression-cxx2b.cpp +++ b/clang/test/SemaCXX/constant-expression-cxx2b.cpp @@ -1,8 +1,8 @@ -// RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify=expected,cxx2a %s -fcxx-exceptions -triple=x86_64-linux-gnu -Wno-c++2b-extensions -// RUN: %clang_cc1 -std=c++2b -fsyntax-only -verify=expected,cxx2b %s -fcxx-exceptions -triple=x86_64-linux-gnu -Wpre-c++2b-compat +// RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify=expected,cxx2a %s -fcxx-exceptions -triple=x86_64-linux-gnu -Wno-c++23-extensions +// RUN: %clang_cc1 -std=c++23 -fsyntax-only -verify=expected,cxx23 %s -fcxx-exceptions -triple=x86_64-linux-gnu -Wpre-c++23-compat struct NonLiteral { // cxx2a-note {{'NonLiteral' is not literal}} \ - // cxx2b-note 2{{'NonLiteral' is not literal}} + // cxx23-note 2{{'NonLiteral' is not literal}} NonLiteral() {} }; @@ -12,42 +12,42 @@ constexpr int f(int n) { // expected-error {{constexpr function never produces a constant expression}} static const int m = n; // expected-note {{control flows through the definition of a static variable}} \ - // cxx2b-warning {{definition of a static variable in a constexpr function is incompatible with C++ standards before C++2b}} + // cxx23-warning {{definition of a static variable in a constexpr function is incompatible with C++ standards before C++23}} return m; } constexpr int g(int n) { // expected-error {{constexpr function never produces a constant expression}} thread_local const int m = n; // expected-note {{control flows through the definition of a thread_local variable}} \ - // cxx2b-warning {{definition of a thread_local variable in a constexpr function is incompatible with C++ standards before C++2b}} + // cxx23-warning {{definition of a thread_local variable in a constexpr function is incompatible with C++ standards before C++23}} return m; } constexpr int c_thread_local(int n) { // expected-error {{constexpr function never produces a constant expression}} static _Thread_local int m = 0; // expected-note {{control flows through the definition of a thread_local variable}} \ - // cxx2b-warning {{definition of a static variable in a constexpr function is incompatible with C++ standards before C++2b}} + // cxx23-warning {{definition of a static variable in a constexpr function is incompatible with C++ standards before C++23}} return m; } constexpr int gnu_thread_local(int n) { // expected-error {{constexpr function never produces a constant expression}} static __thread int m = 0; // expected-note {{control flows through the definition of a thread_local variable}} \ - // cxx2b-warning {{definition of a static variable in a constexpr function is incompatible with C++ standards before C++2b}} + // cxx23-warning {{definition of a static variable in a constexpr function is incompatible with C++ standards before C++23}} return m; } constexpr int h(int n) { // expected-error {{constexpr function never produces a constant expression}} static const int m = n; // expected-note {{control flows through the definition of a static variable}} \ - // cxx2b-warning {{definition of a static variable in a constexpr function is incompatible with C++ standards before C++2b}} + // cxx23-warning {{definition of a static variable in a constexpr function is incompatible with C++ standards before C++23}} return &m - &m; } constexpr int i(int n) { // expected-error {{constexpr function never produces a constant expression}} thread_local const int m = n; // expected-note {{control flows through the definition of a thread_local variable}} \ - // cxx2b-warning {{definition of a thread_local variable in a constexpr function is incompatible with C++ standards before C++2b}} + // cxx23-warning {{definition of a thread_local variable in a constexpr function is incompatible with C++ standards before C++23}} return &m - &m; } constexpr int j(int n) { if (!n) return 0; - static const int m = n; // cxx2b-warning {{definition of a static variable in a constexpr function is incompatible with C++ standards before C++2b}} + static const int m = n; // cxx23-warning {{definition of a static variable in a constexpr function is incompatible with C++ standards before C++23}} return m; } constexpr int j0 = j(0); @@ -55,7 +55,7 @@ constexpr int k(int n) { if (!n) return 0; - thread_local const int m = n; // cxx2b-warning {{definition of a thread_local variable in a constexpr function is incompatible with C++ standards before C++2b}} + thread_local const int m = n; // cxx23-warning {{definition of a thread_local variable in a constexpr function is incompatible with C++ standards before C++23}} return m; } @@ -65,7 +65,7 @@ if (!n) return 0; static const int m = n; // expected-note {{control flows through the definition of a static variable}} \ - // cxx2b-warning {{definition of a static variable in a constexpr function is incompatible with C++ standards before C++2b}} + // cxx23-warning {{definition of a static variable in a constexpr function is incompatible with C++ standards before C++23}} return m; } @@ -76,7 +76,7 @@ if (!n) return 0; thread_local const int m = n; // expected-note {{control flows through the definition of a thread_local variable}} \ - // cxx2b-warning {{definition of a thread_local variable in a constexpr function is incompatible with C++ standards before C++2b}} + // cxx23-warning {{definition of a thread_local variable in a constexpr function is incompatible with C++ standards before C++23}} return m; } @@ -85,21 +85,21 @@ // expected-note {{in call}} constexpr int static_constexpr() { - static constexpr int m = 42; // cxx2b-warning {{definition of a static variable in a constexpr function is incompatible with C++ standards before C++2b}} - static constexpr Constexpr foo; // cxx2b-warning {{definition of a static variable in a constexpr function is incompatible with C++ standards before C++2b}} + static constexpr int m = 42; // cxx23-warning {{definition of a static variable in a constexpr function is incompatible with C++ standards before C++23}} + static constexpr Constexpr foo; // cxx23-warning {{definition of a static variable in a constexpr function is incompatible with C++ standards before C++23}} return m; } constexpr int thread_local_constexpr() { - thread_local constexpr int m = 42; // cxx2b-warning {{definition of a thread_local variable in a constexpr function is incompatible with C++ standards before C++2b}} - thread_local constexpr Constexpr foo; // cxx2b-warning {{definition of a thread_local variable in a constexpr function is incompatible with C++ standards before C++2b}} + thread_local constexpr int m = 42; // cxx23-warning {{definition of a thread_local variable in a constexpr function is incompatible with C++ standards before C++23}} + thread_local constexpr Constexpr foo; // cxx23-warning {{definition of a thread_local variable in a constexpr function is incompatible with C++ standards before C++23}} return m; } constexpr int non_literal(bool b) { if (!b) return 0; - NonLiteral n; // cxx2b-warning {{definition of a variable of non-literal type in a constexpr function is incompatible with C++ standards before C++2b}} + NonLiteral n; // cxx23-warning {{definition of a variable of non-literal type in a constexpr function is incompatible with C++ standards before C++23}} } constexpr int non_literal_1 = non_literal(false); @@ -111,7 +111,7 @@ return 0; } else { goto test; // expected-note {{subexpression not valid in a constant expression}} \ - // cxx2b-warning {{use of this statement in a constexpr function is incompatible with C++ standards before C++2b}} + // cxx23-warning {{use of this statement in a constexpr function is incompatible with C++ standards before C++23}} } test: return 0; @@ -124,7 +124,7 @@ constexpr int label() { -test: // cxx2b-warning {{use of this statement in a constexpr function is incompatible with C++ standards before C++2b}} +test: // cxx23-warning {{use of this statement in a constexpr function is incompatible with C++ standards before C++23}} return 0; } @@ -138,14 +138,14 @@ // This is to be contrasted with the test for implicitly constexpr lambdas below. int test_in_lambdas() { auto a = []() constexpr { - static const int m = 32; // cxx2b-warning {{definition of a static variable in a constexpr function is incompatible with C++ standards before C++2b}} + static const int m = 32; // cxx23-warning {{definition of a static variable in a constexpr function is incompatible with C++ standards before C++23}} return m; }; auto b = [](int n) constexpr { if (!n) return 0; - static const int m = n; // cxx2b-warning {{definition of a static variable in a constexpr function is incompatible with C++ standards before C++2b}} + static const int m = n; // cxx23-warning {{definition of a static variable in a constexpr function is incompatible with C++ standards before C++23}} return m; } (1); @@ -155,7 +155,7 @@ return 0; else goto test; // expected-note {{subexpression not valid in a constant expression}} \ - // cxx2b-warning {{use of this statement in a constexpr function is incompatible with C++ standards before C++2b}} + // cxx23-warning {{use of this statement in a constexpr function is incompatible with C++ standards before C++23}} test: return 1; }; @@ -165,15 +165,15 @@ auto non_literal = [](bool b) constexpr { if (!b) - NonLiteral n; // cxx2b-note {{non-literal type 'NonLiteral' cannot be used in a constant expression}} \ - // cxx2a-error {{variable of non-literal type 'NonLiteral' cannot be defined in a constexpr function before C++2b}} \ - // cxx2b-warning {{definition of a variable of non-literal type in a constexpr function is incompatible with C++ standards before C++2b}} + NonLiteral n; // cxx23-note {{non-literal type 'NonLiteral' cannot be used in a constant expression}} \ + // cxx2a-error {{variable of non-literal type 'NonLiteral' cannot be defined in a constexpr function before C++23}} \ + // cxx23-warning {{definition of a variable of non-literal type in a constexpr function is incompatible with C++ standards before C++23}} return 0; }; #if __cplusplus > 202002L - constexpr auto non_literal_ko = non_literal(false); // cxx2b-error {{constexpr variable 'non_literal_ko' must be initialized by a constant expression}} \ - // cxx2b-note {{in call}} + constexpr auto non_literal_ko = non_literal(false); // cxx23-error {{constexpr variable 'non_literal_ko' must be initialized by a constant expression}} \ + // cxx23-note {{in call}} constexpr auto non_literal_ok = non_literal(true); #endif @@ -187,7 +187,7 @@ auto b = [](int n) { // cxx2a-note 2{{declared here}} if (!n) return 0; - static const int m = n; // cxx2b-note {{control flows through the definition of a static variable}} + static const int m = n; // cxx23-note {{control flows through the definition of a static variable}} return m; }; @@ -197,13 +197,13 @@ constexpr auto b3 = b(1); // expected-error{{constexpr variable 'b3' must be initialized by a constant expression}} \ // cxx2a-note {{non-constexpr function}} \ - // cxx2b-note {{in call}} + // cxx23-note {{in call}} auto c = [](int n) { // cxx2a-note 2{{declared here}} if (!n) return 0; else - goto test; // cxx2b-note {{subexpression not valid in a constant expression}} + goto test; // cxx23-note {{subexpression not valid in a constant expression}} test: return 1; }; @@ -213,17 +213,17 @@ constexpr auto c_error = c(1); // expected-error {{constexpr variable 'c_error' must be initialized by a constant expression}} \ // cxx2a-note {{non-constexpr function}} \ - // cxx2b-note {{in call to}} + // cxx23-note {{in call to}} auto non_literal = [](bool b) { // cxx2a-note 2{{declared here}} if (b) - NonLiteral n; // cxx2b-note {{non-literal type 'NonLiteral' cannot be used in a constant expression}} + NonLiteral n; // cxx23-note {{non-literal type 'NonLiteral' cannot be used in a constant expression}} return 0; }; constexpr auto non_literal_ko = non_literal(true); // expected-error {{constexpr variable 'non_literal_ko' must be initialized by a constant expression}} \ // cxx2a-note {{non-constexpr function}} \ - // cxx2b-note {{in call}} + // cxx23-note {{in call}} constexpr auto non_literal_ok = non_literal(false); // cxx2a-error {{must be initialized by a constant expression}} \ // cxx2a-note {{non-constexpr function}} @@ -238,8 +238,8 @@ }; } -constexpr auto non_literal_valid_in_cxx2b = dependent_var_def_lambda()(true); // \ - // cxx2a-error {{constexpr variable 'non_literal_valid_in_cxx2b' must be initialized by a constant expression}} \ +constexpr auto non_literal_valid_in_cxx23 = dependent_var_def_lambda()(true); // \ + // cxx2a-error {{constexpr variable 'non_literal_valid_in_cxx23' must be initialized by a constant expression}} \ // cxx2a-note {{non-constexpr function}} @@ -249,8 +249,8 @@ return 42; } }; - thread_local constexpr Constexpr t; // cxx2b-warning {{before C++2b}} - static constexpr Constexpr s; // cxx2b-warning {{before C++2b}} + thread_local constexpr Constexpr t; // cxx23-warning {{before C++23}} + static constexpr Constexpr s; // cxx23-warning {{before C++23}} return t.f() + s.f(); } static_assert(evaluate_static_constexpr() == 84); diff --git a/clang/test/SemaCXX/conversion-function.cpp b/clang/test/SemaCXX/conversion-function.cpp --- a/clang/test/SemaCXX/conversion-function.cpp +++ b/clang/test/SemaCXX/conversion-function.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -std=c++2b -fsyntax-only -verify=expected -triple %itanium_abi_triple -Wbind-to-temporary-copy %s +// RUN: %clang_cc1 -std=c++23 -fsyntax-only -verify=expected -triple %itanium_abi_triple -Wbind-to-temporary-copy %s // RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify=expected -triple %itanium_abi_triple -Wbind-to-temporary-copy %s // RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify=expected,cxx98_11,cxx11 -triple %itanium_abi_triple -Wbind-to-temporary-copy %s // RUN: %clang_cc1 -std=c++98 -fsyntax-only -verify=expected,cxx98_11,cxx98 -triple %itanium_abi_triple -Wbind-to-temporary-copy %s diff --git a/clang/test/SemaCXX/coroutines.cpp b/clang/test/SemaCXX/coroutines.cpp --- a/clang/test/SemaCXX/coroutines.cpp +++ b/clang/test/SemaCXX/coroutines.cpp @@ -1,8 +1,8 @@ // This file contains references to sections of the Coroutines TS, which can be // found at http://wg21.link/coroutines. -// RUN: %clang_cc1 -std=c++2b -fsyntax-only -verify=expected,cxx20_2b,cxx2b %s -fcxx-exceptions -fexceptions -Wunused-result -// RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify=expected,cxx14_20,cxx20_2b %s -fcxx-exceptions -fexceptions -Wunused-result +// RUN: %clang_cc1 -std=c++23 -fsyntax-only -verify=expected,cxx20_23,cxx23 %s -fcxx-exceptions -fexceptions -Wunused-result +// RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify=expected,cxx14_20,cxx20_23 %s -fcxx-exceptions -fexceptions -Wunused-result void no_coroutine_traits_bad_arg_await() { co_await a; // expected-error {{include }} @@ -933,7 +933,7 @@ }; extern "C" int f(mismatch_gro_type_tag2) { - // cxx2b-error@-1 {{cannot initialize return object of type 'int' with an rvalue of type 'void *'}} + // cxx23-error@-1 {{cannot initialize return object of type 'int' with an rvalue of type 'void *'}} // cxx14_20-error@-2 {{cannot initialize return object of type 'int' with an lvalue of type 'void *'}} co_return; //expected-note {{function is a coroutine due to use of 'co_return' here}} } @@ -1031,7 +1031,7 @@ // expected-error@+2 {{return type of 'await_suspend' is required to be 'void' or 'bool' (have 'bool &')}} // expected-error@+1 {{return type of 'await_suspend' is required to be 'void' or 'bool' (have 'bool &&')}} SuspendTy await_suspend(std::coroutine_handle<>); - // cxx20_2b-warning@-1 {{volatile-qualified return type 'const volatile bool' is deprecated}} + // cxx20_23-warning@-1 {{volatile-qualified return type 'const volatile bool' is deprecated}} void await_resume(); }; void test_bad_suspend() { @@ -1053,7 +1053,7 @@ await_suspend_type_test a; await_suspend_type_test b; await_suspend_type_test c; - await_suspend_type_test d; // cxx20_2b-note {{in instantiation of template class}} + await_suspend_type_test d; // cxx20_23-note {{in instantiation of template class}} co_await a; // expected-note {{call to 'await_suspend' implicitly required by coroutine function here}} co_await b; // expected-note {{call to 'await_suspend' implicitly required by coroutine function here}} co_await c; // OK @@ -1141,7 +1141,7 @@ } CoroMemberTag test_qual(int *, const float &&, volatile void *volatile) const { - // cxx20_2b-warning@-1 {{volatile-qualified parameter type}} + // cxx20_23-warning@-1 {{volatile-qualified parameter type}} auto TC = co_yield 0; static_assert(TC.MatchesArgs, ""); } @@ -1240,7 +1240,7 @@ } CoroMemberTag test_qual(int *, const float &&, volatile void *volatile) const { - // cxx20_2b-warning@-1 {{volatile-qualified parameter type}} + // cxx20_23-warning@-1 {{volatile-qualified parameter type}} auto TC = co_yield 0; static_assert(TC.template MatchesArgs, ""); } diff --git a/clang/test/SemaCXX/cxx2a-consteval-default-params.cpp b/clang/test/SemaCXX/cxx2a-consteval-default-params.cpp --- a/clang/test/SemaCXX/cxx2a-consteval-default-params.cpp +++ b/clang/test/SemaCXX/cxx2a-consteval-default-params.cpp @@ -1,5 +1,5 @@ // RUN: %clang_cc1 -fsyntax-only -verify -std=c++20 %s -// RUN: %clang_cc1 -fsyntax-only -verify -std=c++2b %s +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++23 %s consteval int undefined(); // expected-note 4 {{declared here}} diff --git a/clang/test/SemaCXX/cxx2b-ast-print.cpp b/clang/test/SemaCXX/cxx2b-ast-print.cpp --- a/clang/test/SemaCXX/cxx2b-ast-print.cpp +++ b/clang/test/SemaCXX/cxx2b-ast-print.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -std=c++2b -fsyntax-only -ast-print %s | FileCheck %s +// RUN: %clang_cc1 -std=c++23 -fsyntax-only -ast-print %s | FileCheck %s template