[clang] 9c4ade0 - [C23] Rename C2x->C23 in diagnostics
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Fri Aug 11 05:42:11 PDT 2023
Author: Aaron Ballman
Date: 2023-08-11T08:42:01-04:00
New Revision: 9c4ade0623af842cda16e5c71b27fb794a3ff3db
URL: https://github.com/llvm/llvm-project/commit/9c4ade0623af842cda16e5c71b27fb794a3ff3db
DIFF: https://github.com/llvm/llvm-project/commit/9c4ade0623af842cda16e5c71b27fb794a3ff3db.diff
LOG: [C23] Rename C2x->C23 in diagnostics
This renames C2x to C23 in diagnostic identifiers and messages. The
changes were made mechanically.
Added:
Modified:
clang/include/clang/Basic/DiagnosticCommonKinds.td
clang/include/clang/Basic/DiagnosticGroups.td
clang/include/clang/Basic/DiagnosticLexKinds.td
clang/include/clang/Basic/DiagnosticParseKinds.td
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/lib/Basic/IdentifierTable.cpp
clang/lib/Lex/Lexer.cpp
clang/lib/Lex/LiteralSupport.cpp
clang/lib/Lex/PPDirectives.cpp
clang/lib/Lex/PPExpressions.cpp
clang/lib/Parse/ParseDecl.cpp
clang/lib/Parse/ParseDeclCXX.cpp
clang/lib/Parse/ParseExpr.cpp
clang/lib/Parse/ParseInit.cpp
clang/lib/Parse/ParseStmt.cpp
clang/lib/Sema/SemaChecking.cpp
clang/lib/Sema/SemaExpr.cpp
clang/test/Analysis/region-store.c
clang/test/C/C11/n1330.c
clang/test/C/C2x/n2607.c
clang/test/C/C2x/n2900_n3011.c
clang/test/C/C2x/n2934.c
clang/test/C/C2x/n2975.c
clang/test/C/drs/dr0xx.c
clang/test/C/drs/dr2xx.c
clang/test/C/drs/dr3xx.c
clang/test/C/drs/dr4xx.c
clang/test/CodeGen/2009-06-01-addrofknr.c
clang/test/Lexer/Inputs/unsafe-macro-2.h
clang/test/Lexer/bitint-constants-compat.c
clang/test/Lexer/deprecate-macro.c
clang/test/Lexer/keywords_test.c
clang/test/Parser/c2x-func-prototype.c
clang/test/Parser/c2x-label.c
clang/test/Parser/c2x-typeof-ext-warns.c
clang/test/Parser/declarators.c
clang/test/Parser/static_assert.c
clang/test/Preprocessor/elifdef.c
clang/test/Preprocessor/ext-pp-directive.c
clang/test/Preprocessor/if_warning.c
clang/test/Preprocessor/ifdef-recover.c
clang/test/Preprocessor/macro_misc.c
clang/test/Sema/arg-duplicate.c
clang/test/Sema/array-init.c
clang/test/Sema/block-args.c
clang/test/Sema/c2x-attr.c
clang/test/Sema/c2x-func-prototype.c
clang/test/Sema/c2x-noreturn.c
clang/test/Sema/c89.c
clang/test/Sema/complex-init-list.c
clang/test/Sema/compound-literal.c
clang/test/Sema/empty-init.c
clang/test/Sema/flexible-array-init.c
clang/test/Sema/function.c
clang/test/Sema/knr-def-call.c
clang/test/Sema/knr-variadic-def.c
clang/test/Sema/matrix-type-builtins.c
clang/test/Sema/nullptr-prec2x.c
clang/test/Sema/pre-c2x-compat.c
clang/test/Sema/vector-gcc-compat.c
clang/test/Sema/vla.c
clang/test/Sema/warn-deprecated-non-prototype.c
clang/test/Sema/warn-strict-prototypes.c
clang/test/SemaObjC/nonnull.m
Removed:
################################################################################
diff --git a/clang/include/clang/Basic/DiagnosticCommonKinds.td b/clang/include/clang/Basic/DiagnosticCommonKinds.td
index ee994e765e09a9..46a21d5da54026 100644
--- a/clang/include/clang/Basic/DiagnosticCommonKinds.td
+++ b/clang/include/clang/Basic/DiagnosticCommonKinds.td
@@ -132,10 +132,10 @@ def warn_missing_type_specifier : Warning<
InGroup<ImplicitInt>, DefaultIgnore;
def ext_c_empty_initializer : Extension<
- "use of an empty initializer is a C2x extension">, InGroup<C2x>;
-def warn_c2x_compat_empty_initializer : Warning<
- "use of an empty initializer is incompatible with C standards before C2x">,
- InGroup<CPre2xCompat>, DefaultIgnore;
+ "use of an empty initializer is a C23 extension">, InGroup<C23>;
+def warn_c23_compat_empty_initializer : Warning<
+ "use of an empty initializer is incompatible with C standards before C23">,
+ InGroup<CPre23Compat>, DefaultIgnore;
}
let CategoryName = "Nullability Issue" in {
@@ -223,12 +223,12 @@ def err_cxx23_size_t_suffix: Error<
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">;
-def ext_c2x_bitint_suffix : ExtWarn<
- "'_BitInt' suffix for literals is a C2x extension">,
- InGroup<C2x>;
-def warn_c2x_compat_bitint_suffix : Warning<
- "'_BitInt' suffix for literals is incompatible with C standards before C2x">,
- InGroup<CPre2xCompat>, DefaultIgnore;
+def ext_c23_bitint_suffix : ExtWarn<
+ "'_BitInt' suffix for literals is a C23 extension">,
+ InGroup<C23>;
+def warn_c23_compat_bitint_suffix : Warning<
+ "'_BitInt' suffix for literals is incompatible with C standards before C23">,
+ InGroup<CPre23Compat>, DefaultIgnore;
def err_integer_literal_too_large : Error<
"integer literal is too large to be represented in any %select{signed |}0"
"integer type">;
diff --git a/clang/include/clang/Basic/DiagnosticGroups.td b/clang/include/clang/Basic/DiagnosticGroups.td
index ab990aaacc0ebd..990f223f755490 100644
--- a/clang/include/clang/Basic/DiagnosticGroups.td
+++ b/clang/include/clang/Basic/DiagnosticGroups.td
@@ -144,7 +144,9 @@ def MacroRedefined : DiagGroup<"macro-redefined">;
def BuiltinMacroRedefined : DiagGroup<"builtin-macro-redefined">;
def BuiltinRequiresHeader : DiagGroup<"builtin-requires-header">;
def C99Compat : DiagGroup<"c99-compat">;
-def C2xCompat : DiagGroup<"c2x-compat">;
+def C23Compat : DiagGroup<"c23-compat">;
+def : DiagGroup<"c2x-compat", [C23Compat]>;
+
def CXXCompat: DiagGroup<"c++-compat">;
def ExternCCompat : DiagGroup<"extern-c-compat">;
def KeywordCompat : DiagGroup<"keyword-compat">;
@@ -287,9 +289,11 @@ def : DiagGroup<"c++1z-compat-mangling", [CXX17CompatMangling]>;
def NoexceptType : DiagGroup<"noexcept-type", [CXX17CompatMangling]>;
// Warnings for C code which is not compatible with previous C standards.
-def CPre2xCompat : DiagGroup<"pre-c2x-compat">;
-def CPre2xCompatPedantic : DiagGroup<"pre-c2x-compat-pedantic",
- [CPre2xCompat]>;
+def CPre23Compat : DiagGroup<"pre-c23-compat">;
+def CPre23CompatPedantic : DiagGroup<"pre-c23-compat-pedantic",
+ [CPre23Compat]>;
+def : DiagGroup<"pre-c2x-compat", [CPre23Compat]>;
+def : DiagGroup<"pre-c2x-compat-pedantic", [CPre23CompatPedantic]>;
// Warnings for C++ code which is not compatible with previous C++ standards.
def CXXPre14Compat : DiagGroup<"pre-c++14-compat">;
@@ -1143,8 +1147,10 @@ def C11 : DiagGroup<"c11-extensions">;
// A warning group for warnings about using C99 features as extensions.
def C99 : DiagGroup<"c99-extensions", [C99Designator]>;
-// A warning group for warnings about using C2x features as extensions.
-def C2x : DiagGroup<"c2x-extensions">;
+// A warning group for warnings about using C23 features as extensions.
+def C23 : DiagGroup<"c23-extensions">;
+
+def : DiagGroup<"c2x-extensions", [C23]>;
// A warning group for warnings about GCC extensions.
def GNU : DiagGroup<"gnu", [GNUAlignofExpression, GNUAnonymousStruct,
diff --git a/clang/include/clang/Basic/DiagnosticLexKinds.td b/clang/include/clang/Basic/DiagnosticLexKinds.td
index 6ad691975bd587..940cca67368492 100644
--- a/clang/include/clang/Basic/DiagnosticLexKinds.td
+++ b/clang/include/clang/Basic/DiagnosticLexKinds.td
@@ -82,8 +82,8 @@ def warn_cxx20_keyword : Warning<"'%0' is a keyword in C++20">,
InGroup<CXX20Compat>, DefaultIgnore;
def warn_c99_keyword : Warning<"'%0' is a keyword in C99">,
InGroup<C99Compat>, DefaultIgnore;
-def warn_c2x_keyword : Warning<"'%0' is a keyword in C2x">,
- InGroup<C2xCompat>, DefaultIgnore;
+def warn_c23_keyword : Warning<"'%0' is a keyword in C23">,
+ InGroup<C23Compat>, DefaultIgnore;
def ext_unterminated_char_or_string : ExtWarn<
"missing terminating %select{'|'\"'}0 character">, InGroup<InvalidPPToken>;
@@ -197,14 +197,14 @@ def warn_cxx98_compat_literal_ucn_escape_basic_scs : Warning<
def warn_cxx98_compat_literal_ucn_control_character : Warning<
"universal character name referring to a control character "
"is incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
-def warn_c2x_compat_literal_ucn_escape_basic_scs : Warning<
+def warn_c23_compat_literal_ucn_escape_basic_scs : Warning<
"specifying character '%0' with a universal character name is "
- "incompatible with C standards before C2x">,
- InGroup<CPre2xCompat>, DefaultIgnore;
-def warn_c2x_compat_literal_ucn_control_character : Warning<
+ "incompatible with C standards before C23">,
+ InGroup<CPre23Compat>, DefaultIgnore;
+def warn_c23_compat_literal_ucn_control_character : Warning<
"universal character name referring to a control character "
- "is incompatible with C standards before C2x">,
- InGroup<CPre2xCompat>, DefaultIgnore;
+ "is incompatible with C standards before C23">,
+ InGroup<CPre23Compat>, DefaultIgnore;
def warn_ucn_not_valid_in_c89 : Warning<
"universal character names are only valid in C99 or C++; "
"treating as '\\' followed by identifier">, InGroup<Unicode>;
@@ -224,9 +224,9 @@ def err_invalid_suffix_constant : Error<
def warn_cxx11_compat_digit_separator : Warning<
"digit separators are incompatible with C++ standards before C++14">,
InGroup<CXXPre14Compat>, DefaultIgnore;
-def warn_c2x_compat_digit_separator : Warning<
- "digit separators are incompatible with C standards before C2x">,
- InGroup<CPre2xCompat>, DefaultIgnore;
+def warn_c23_compat_digit_separator : Warning<
+ "digit separators are incompatible with C standards before C23">,
+ InGroup<CPre23Compat>, DefaultIgnore;
def err_digit_separator_not_between_digits : Error<
"digit separator cannot appear at %select{start|end}0 of digit sequence">;
def warn_char_constant_too_large : Warning<
@@ -415,13 +415,13 @@ def ext_pp_include_next_directive : Extension<
"#include_next is a language extension">, InGroup<GNUIncludeNext>;
def ext_pp_warning_directive : Extension<
- "#warning is a %select{C2x|C++23}0 extension">;
+ "#warning is a %select{C23|C++23}0 extension">;
def warn_cxx23_compat_warning_directive : Warning<
"#warning is incompatible with C++ standards before C++23">,
InGroup<CXXPre23Compat>, DefaultIgnore;
-def warn_c2x_compat_warning_directive : Warning<
- "#warning is incompatible with C standards before C2x">,
- InGroup<CPre2xCompat>, DefaultIgnore;
+def warn_c23_compat_warning_directive : Warning<
+ "#warning is incompatible with C standards before C23">,
+ InGroup<CPre23Compat>, DefaultIgnore;
def ext_pp_extra_tokens_at_eol : ExtWarn<
"extra tokens at end of #%0 directive">, InGroup<ExtraTokens>;
@@ -750,14 +750,14 @@ def warn_cxx98_compat_pp_line_too_big : Warning<
"#line number greater than 32767 is incompatible with C++98">,
InGroup<CXX98CompatPedantic>, DefaultIgnore;
-def warn_c2x_compat_pp_directive : Warning<
+def warn_c23_compat_pp_directive : Warning<
"use of a '#%select{<BUG IF SEEN>|elifdef|elifndef}0' directive "
- "is incompatible with C standards before C2x">,
- InGroup<CPre2xCompat>, DefaultIgnore;
-def ext_c2x_pp_directive : ExtWarn<
+ "is incompatible with C standards before C23">,
+ InGroup<CPre23Compat>, DefaultIgnore;
+def ext_c23_pp_directive : ExtWarn<
"use of a '#%select{<BUG IF SEEN>|elifdef|elifndef}0' directive "
- "is a C2x extension">,
- InGroup<C2x>;
+ "is a C23 extension">,
+ InGroup<C23>;
def warn_cxx23_compat_pp_directive : Warning<
"use of a '#%select{<BUG IF SEEN>|elifdef|elifndef}0' directive "
"is incompatible with C++ standards before C++23">,
diff --git a/clang/include/clang/Basic/DiagnosticParseKinds.td b/clang/include/clang/Basic/DiagnosticParseKinds.td
index a804442ab34ec7..178761bdcf4d5e 100644
--- a/clang/include/clang/Basic/DiagnosticParseKinds.td
+++ b/clang/include/clang/Basic/DiagnosticParseKinds.td
@@ -165,9 +165,9 @@ def ext_c99_feature : Extension<
"'%0' is a C99 extension">, InGroup<C99>;
def ext_c11_feature : Extension<
"'%0' is a C11 extension">, InGroup<C11>;
-def warn_c2x_compat_keyword : Warning<
- "'%0' is incompatible with C standards before C2x">,
- InGroup<CPre2xCompat>, DefaultIgnore;
+def warn_c23_compat_keyword : Warning<
+ "'%0' is incompatible with C standards before C23">,
+ InGroup<CPre23Compat>, DefaultIgnore;
def err_c11_noreturn_misplaced : Error<
"'_Noreturn' keyword must precede function declarator">;
@@ -300,14 +300,14 @@ def note_force_empty_selector_name : Note<
"or insert whitespace before ':' to use %0 as parameter name "
"and have an empty entry in the selector">;
def ext_c_label_end_of_compound_statement : ExtWarn<
- "label at end of compound statement is a C2x extension">,
- InGroup<C2x>;
+ "label at end of compound statement is a C23 extension">,
+ InGroup<C23>;
def ext_cxx_label_end_of_compound_statement : ExtWarn<
"label at end of compound statement is a C++23 extension">,
InGroup<CXX23>;
-def warn_c2x_compat_label_end_of_compound_statement : Warning<
- "label at end of compound statement is incompatible with C standards before C2x">,
- InGroup<CPre2xCompat>, DefaultIgnore;
+def warn_c23_compat_label_end_of_compound_statement : Warning<
+ "label at end of compound statement is incompatible with C standards before C23">,
+ InGroup<CPre23Compat>, DefaultIgnore;
def warn_cxx20_compat_label_end_of_compound_statement : Warning<
"label at end of compound statement is incompatible with C++ standards before C++23">,
InGroup<CXXPre23Compat>, DefaultIgnore;
@@ -447,15 +447,15 @@ def ext_ms_static_assert : ExtWarn<
def ext_cxx_static_assert_no_message : ExtWarn<
"'static_assert' with no message is a C++17 extension">, InGroup<CXX17>;
def ext_c_static_assert_no_message : ExtWarn<
- "'_Static_assert' with no message is a C2x extension">, InGroup<C2x>;
+ "'_Static_assert' with no message is a C23 extension">, InGroup<C23>;
def warn_cxx14_compat_static_assert_no_message : Warning<
"'static_assert' with no message is incompatible with C++ standards before "
"C++17">,
DefaultIgnore, InGroup<CXXPre17Compat>;
def warn_c17_compat_static_assert_no_message : Warning<
"'_Static_assert' with no message is incompatible with C standards before "
- "C2x">,
- DefaultIgnore, InGroup<CPre2xCompat>;
+ "C23">,
+ DefaultIgnore, InGroup<CPre23Compat>;
def err_function_definition_not_allowed : Error<
"function definition is not allowed here">;
def err_expected_end_of_enumerator : Error<
@@ -704,7 +704,7 @@ def warn_cxx98_compat_noexcept_expr : Warning<
def warn_cxx98_compat_nullptr : Warning<
"'nullptr' is incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
def ext_c_nullptr : Extension<
- "'nullptr' is a C2x extension">, InGroup<C2x>;
+ "'nullptr' is a C23 extension">, InGroup<C23>;
def warn_wrong_clang_attr_namespace : Warning<
"'__clang__' is a predefined macro name, not an attribute scope specifier; "
@@ -724,12 +724,12 @@ def warn_cxx98_compat_attribute : Warning<
def warn_ext_cxx11_attributes : Extension<
"[[]] attributes are a C++11 extension">,
InGroup<CXX11>;
-def warn_pre_c2x_compat_attributes : Warning<
- "[[]] attributes are incompatible with C standards before C2x">,
- DefaultIgnore, InGroup<CPre2xCompat>;
-def warn_ext_c2x_attributes : Extension<
- "[[]] attributes are a C2x extension">,
- InGroup<C2x>;
+def warn_pre_c23_compat_attributes : Warning<
+ "[[]] attributes are incompatible with C standards before C23">,
+ DefaultIgnore, InGroup<CPre23Compat>;
+def warn_ext_c23_attributes : Extension<
+ "[[]] attributes are a C23 extension">,
+ InGroup<C23>;
def err_cxx11_attribute_forbids_arguments : Error<
"attribute %0 cannot have an argument list">;
def err_attribute_requires_arguments : Error<
diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td
index 7e271ba166077b..95f8f0247d4b78 100644
--- a/clang/include/clang/Basic/DiagnosticSemaKinds.td
+++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td
@@ -300,9 +300,9 @@ def err_bad_parameter_name : Error<
"%0 cannot be the name of a parameter">;
def err_bad_parameter_name_template_id : Error<
"parameter name cannot have template arguments">;
-def ext_parameter_name_omitted_c2x : ExtWarn<
- "omitting the parameter name in a function definition is a C2x extension">,
- InGroup<C2x>;
+def ext_parameter_name_omitted_c23 : ExtWarn<
+ "omitting the parameter name in a function definition is a C23 extension">,
+ InGroup<C23>;
def err_anyx86_interrupt_attribute : Error<
"%select{x86|x86-64}0 'interrupt' attribute only applies to functions that "
"have %select{a 'void' return type|"
@@ -4182,7 +4182,7 @@ def warn_vector_mode_deprecated : Warning<
"use the 'vector_size' attribute instead">,
InGroup<DeprecatedAttributes>;
def warn_deprecated_noreturn_spelling : Warning<
- "the '[[_Noreturn]]' attribute spelling is deprecated in C2x; use "
+ "the '[[_Noreturn]]' attribute spelling is deprecated in C23; use "
"'[[noreturn]]' instead">, InGroup<DeprecatedAttributes>;
def err_complex_mode_vector_type : Error<
"type of machine mode does not support base vector types">;
@@ -5715,7 +5715,7 @@ def note_sentinel_here : Note<
"%select{function|method|block}0 has been explicitly marked sentinel here">;
def warn_strict_uses_without_prototype : Warning<
"passing arguments to %select{a function|%1}0 without a prototype is "
- "deprecated in all versions of C and is not supported in C2x">,
+ "deprecated in all versions of C and is not supported in C23">,
InGroup<DeprecatedNonPrototype>;
def warn_missing_prototype : Warning<
"no previous prototype for function %0">,
@@ -5730,8 +5730,8 @@ def warn_strict_prototypes : Extension<
"%select{in all versions of C|}0">, InGroup<StrictPrototypes>;
def warn_non_prototype_changes_behavior : Warning<
"a function %select{declaration|definition}0 without a prototype is "
- "deprecated in all versions of C %select{and is not supported in C2x|and is "
- "treated as a zero-parameter prototype in C2x, conflicting with a "
+ "deprecated in all versions of C %select{and is not supported in C23|and is "
+ "treated as a zero-parameter prototype in C23, conflicting with a "
"%select{previous|subsequent}2 %select{declaration|definition}3}1">,
InGroup<DeprecatedNonPrototype>;
def note_conflicting_prototype : Note<"conflicting prototype is here">;
@@ -9992,7 +9992,7 @@ def warn_second_arg_of_va_start_not_last_named_param : Warning<
InGroup<Varargs>;
def warn_c17_compat_ellipsis_only_parameter : Warning<
"'...' as the only parameter of a function is incompatible with C standards "
- "before C2x">, DefaultIgnore, InGroup<CPre2xCompat>;
+ "before C23">, DefaultIgnore, InGroup<CPre23Compat>;
def warn_va_start_type_is_undefined : Warning<
"passing %select{an object that undergoes default argument promotion|"
"an object of reference type|a parameter declared with the 'register' "
diff --git a/clang/lib/Basic/IdentifierTable.cpp b/clang/lib/Basic/IdentifierTable.cpp
index 57767fd2a1f152..afb30268f2973c 100644
--- a/clang/lib/Basic/IdentifierTable.cpp
+++ b/clang/lib/Basic/IdentifierTable.cpp
@@ -915,7 +915,7 @@ IdentifierTable::getFutureCompatDiagKind(const IdentifierInfo &II,
if ((Flags & KEYC99) == KEYC99)
return diag::warn_c99_keyword;
if ((Flags & KEYC23) == KEYC23)
- return diag::warn_c2x_keyword;
+ return diag::warn_c23_keyword;
}
llvm_unreachable(
diff --git a/clang/lib/Lex/Lexer.cpp b/clang/lib/Lex/Lexer.cpp
index 15b78ca7eb0879..fc73bbffdd132b 100644
--- a/clang/lib/Lex/Lexer.cpp
+++ b/clang/lib/Lex/Lexer.cpp
@@ -1959,7 +1959,7 @@ bool Lexer::LexNumericConstant(Token &Result, const char *CurPtr) {
if (!isLexingRawMode())
Diag(CurPtr, LangOpts.CPlusPlus
? diag::warn_cxx11_compat_digit_separator
- : diag::warn_c2x_compat_digit_separator);
+ : diag::warn_c23_compat_digit_separator);
CurPtr = ConsumeChar(CurPtr, Size, Result);
CurPtr = ConsumeChar(CurPtr, NextSize, Result);
return LexNumericConstant(Result, CurPtr);
diff --git a/clang/lib/Lex/LiteralSupport.cpp b/clang/lib/Lex/LiteralSupport.cpp
index 22a417b9aa1fe1..2de307883b97ce 100644
--- a/clang/lib/Lex/LiteralSupport.cpp
+++ b/clang/lib/Lex/LiteralSupport.cpp
@@ -689,14 +689,14 @@ static bool ProcessUCNEscape(const char *ThisTokBegin, const char *&ThisTokBuf,
IsError ? diag::err_ucn_escape_basic_scs
: Features.CPlusPlus
? diag::warn_cxx98_compat_literal_ucn_escape_basic_scs
- : diag::warn_c2x_compat_literal_ucn_escape_basic_scs)
+ : diag::warn_c23_compat_literal_ucn_escape_basic_scs)
<< StringRef(&BasicSCSChar, 1);
else
Diag(Diags, Features, Loc, ThisTokBegin, UcnBegin, ThisTokBuf,
IsError ? diag::err_ucn_control_character
: Features.CPlusPlus
? diag::warn_cxx98_compat_literal_ucn_control_character
- : diag::warn_c2x_compat_literal_ucn_control_character);
+ : diag::warn_c23_compat_literal_ucn_control_character);
}
if (IsError)
return false;
diff --git a/clang/lib/Lex/PPDirectives.cpp b/clang/lib/Lex/PPDirectives.cpp
index a130ff15d2fed4..eb660b9d6e7515 100644
--- a/clang/lib/Lex/PPDirectives.cpp
+++ b/clang/lib/Lex/PPDirectives.cpp
@@ -767,8 +767,8 @@ void Preprocessor::SkipExcludedConditionalBlock(SourceLocation HashTokenLoc,
DiagID = LangOpts.CPlusPlus23 ? diag::warn_cxx23_compat_pp_directive
: diag::ext_cxx23_pp_directive;
else
- DiagID = LangOpts.C23 ? diag::warn_c2x_compat_pp_directive
- : diag::ext_c2x_pp_directive;
+ DiagID = LangOpts.C23 ? diag::warn_c23_compat_pp_directive
+ : diag::ext_c23_pp_directive;
Diag(Tok, DiagID) << (IsElifDef ? PED_Elifdef : PED_Elifndef);
// If this is a #elif with a #else before it, report the error.
@@ -1277,7 +1277,7 @@ void Preprocessor::HandleDirective(Token &Result) {
: diag::ext_pp_warning_directive)
<< /*C++23*/ 1;
else
- Diag(Result, LangOpts.C23 ? diag::warn_c2x_compat_warning_directive
+ Diag(Result, LangOpts.C23 ? diag::warn_c23_compat_warning_directive
: diag::ext_pp_warning_directive)
<< /*C23*/ 0;
@@ -3453,8 +3453,8 @@ void Preprocessor::HandleElifFamilyDirective(Token &ElifToken,
DiagID = LangOpts.CPlusPlus23 ? diag::warn_cxx23_compat_pp_directive
: diag::ext_cxx23_pp_directive;
else
- DiagID = LangOpts.C23 ? diag::warn_c2x_compat_pp_directive
- : diag::ext_c2x_pp_directive;
+ DiagID = LangOpts.C23 ? diag::warn_c23_compat_pp_directive
+ : diag::ext_c23_pp_directive;
Diag(ElifToken, DiagID) << DirKind;
break;
default:
diff --git a/clang/lib/Lex/PPExpressions.cpp b/clang/lib/Lex/PPExpressions.cpp
index 7468313c7b9778..269984aae07bf2 100644
--- a/clang/lib/Lex/PPExpressions.cpp
+++ b/clang/lib/Lex/PPExpressions.cpp
@@ -336,8 +336,8 @@ static bool EvaluateValue(PPValue &Result, Token &PeekTok, DefinedTracker &DT,
// to a library type may be more appropriate there.
if (Literal.isBitInt)
PP.Diag(PeekTok, PP.getLangOpts().C23
- ? diag::warn_c2x_compat_bitint_suffix
- : diag::ext_c2x_bitint_suffix);
+ ? diag::warn_c23_compat_bitint_suffix
+ : diag::ext_c23_bitint_suffix);
// Parse the integer literal into Result.
if (Literal.GetIntegerValue(Result.Val)) {
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp
index 48a7f7db758b78..2840b48cce1eb1 100644
--- a/clang/lib/Parse/ParseDecl.cpp
+++ b/clang/lib/Parse/ParseDecl.cpp
@@ -4000,7 +4000,7 @@ void Parser::ParseDeclarationSpecifiers(
break;
case tok::kw_thread_local:
if (getLangOpts().C23)
- Diag(Tok, diag::warn_c2x_compat_keyword) << Tok.getName();
+ Diag(Tok, diag::warn_c23_compat_keyword) << Tok.getName();
isInvalid = DS.SetStorageClassSpecThread(DeclSpec::TSCS_thread_local, Loc,
PrevSpec, DiagID);
isStorageClass = true;
@@ -4237,7 +4237,7 @@ void Parser::ParseDeclarationSpecifiers(
break;
case tok::kw_bool:
if (getLangOpts().C23)
- Diag(Tok, diag::warn_c2x_compat_keyword) << Tok.getName();
+ Diag(Tok, diag::warn_c23_compat_keyword) << Tok.getName();
[[fallthrough]];
case tok::kw__Bool:
if (Tok.is(tok::kw__Bool) && !getLangOpts().C99)
@@ -7752,7 +7752,7 @@ void Parser::ParseTypeofSpecifier(DeclSpec &DS) {
bool IsUnqual = Tok.is(tok::kw_typeof_unqual);
const IdentifierInfo *II = Tok.getIdentifierInfo();
if (getLangOpts().C23 && !II->getName().startswith("__"))
- Diag(Tok.getLocation(), diag::warn_c2x_compat_keyword) << Tok.getName();
+ Diag(Tok.getLocation(), diag::warn_c23_compat_keyword) << Tok.getName();
Token OpTok = Tok;
SourceLocation StartLoc = ConsumeToken();
@@ -7952,7 +7952,7 @@ void Parser::DiagnoseBitIntUse(const Token &Tok) {
// In C23 mode, diagnose that the use is not compatible with pre-C23 modes.
// Otherwise, diagnose that the use is a Clang extension.
if (getLangOpts().C23)
- Diag(Loc, diag::warn_c2x_compat_keyword) << Tok.getName();
+ Diag(Loc, diag::warn_c23_compat_keyword) << Tok.getName();
else
Diag(Loc, diag::ext_bit_int) << getLangOpts().CPlusPlus;
}
diff --git a/clang/lib/Parse/ParseDeclCXX.cpp b/clang/lib/Parse/ParseDeclCXX.cpp
index 7db7a416ea433f..186a5e61a8fa32 100644
--- a/clang/lib/Parse/ParseDeclCXX.cpp
+++ b/clang/lib/Parse/ParseDeclCXX.cpp
@@ -973,7 +973,7 @@ Decl *Parser::ParseStaticAssertDeclaration(SourceLocation &DeclEnd) {
if (Tok.is(tok::kw_static_assert)) {
if (!getLangOpts().CPlusPlus) {
if (getLangOpts().C23)
- Diag(Tok, diag::warn_c2x_compat_keyword) << Tok.getName();
+ Diag(Tok, diag::warn_c23_compat_keyword) << Tok.getName();
else
Diag(Tok, diag::ext_ms_static_assert) << FixItHint::CreateReplacement(
Tok.getLocation(), "_Static_assert");
@@ -4505,7 +4505,7 @@ void Parser::ParseCXX11AttributeSpecifierInternal(ParsedAttributes &Attrs,
SourceLocation *EndLoc) {
if (Tok.is(tok::kw_alignas)) {
if (getLangOpts().C23)
- Diag(Tok, diag::warn_c2x_compat_keyword) << Tok.getName();
+ Diag(Tok, diag::warn_c23_compat_keyword) << Tok.getName();
else
Diag(Tok.getLocation(), diag::warn_cxx98_compat_alignas);
ParseAlignmentSpecifier(Attrs, EndLoc);
@@ -4528,8 +4528,8 @@ void Parser::ParseCXX11AttributeSpecifierInternal(ParsedAttributes &Attrs,
Diag(OpenLoc, getLangOpts().CPlusPlus11 ? diag::warn_cxx98_compat_attribute
: diag::warn_ext_cxx11_attributes);
} else {
- Diag(OpenLoc, getLangOpts().C23 ? diag::warn_pre_c2x_compat_attributes
- : diag::warn_ext_c2x_attributes);
+ Diag(OpenLoc, getLangOpts().C23 ? diag::warn_pre_c23_compat_attributes
+ : diag::warn_ext_c23_attributes);
}
ConsumeBracket();
diff --git a/clang/lib/Parse/ParseExpr.cpp b/clang/lib/Parse/ParseExpr.cpp
index a62144060d1255..bd72de067cfae9 100644
--- a/clang/lib/Parse/ParseExpr.cpp
+++ b/clang/lib/Parse/ParseExpr.cpp
@@ -1011,7 +1011,7 @@ ExprResult Parser::ParseCastExpression(CastParseKind ParseKind,
if (getLangOpts().CPlusPlus)
Diag(Tok, diag::warn_cxx98_compat_nullptr);
else
- Diag(Tok, getLangOpts().C23 ? diag::warn_c2x_compat_keyword
+ Diag(Tok, getLangOpts().C23 ? diag::warn_c23_compat_keyword
: diag::ext_c_nullptr) << Tok.getName();
Res = Actions.ActOnCXXNullPtrLiteral(ConsumeToken());
@@ -2502,7 +2502,7 @@ ExprResult Parser::ParseUnaryExprOrTypeTraitExpression() {
OpTok.isOneOf(tok::kw_alignof, tok::kw__Alignof))
Diag(OpTok, diag::warn_cxx98_compat_alignof);
else if (getLangOpts().C23 && OpTok.is(tok::kw_alignof))
- Diag(OpTok, diag::warn_c2x_compat_keyword) << OpTok.getName();
+ Diag(OpTok, diag::warn_c23_compat_keyword) << OpTok.getName();
EnterExpressionEvaluationContext Unevaluated(
Actions, Sema::ExpressionEvaluationContext::Unevaluated,
diff --git a/clang/lib/Parse/ParseInit.cpp b/clang/lib/Parse/ParseInit.cpp
index 6794cb6a4f05fb..637f21176792b6 100644
--- a/clang/lib/Parse/ParseInit.cpp
+++ b/clang/lib/Parse/ParseInit.cpp
@@ -452,7 +452,7 @@ ExprResult Parser::ParseBraceInitializer() {
// Empty initializers are a C++ feature and a GNU extension to C before C23.
if (!getLangOpts().CPlusPlus) {
Diag(LBraceLoc, getLangOpts().C23
- ? diag::warn_c2x_compat_empty_initializer
+ ? diag::warn_c23_compat_empty_initializer
: diag::ext_c_empty_initializer);
}
// Match the '}'.
diff --git a/clang/lib/Parse/ParseStmt.cpp b/clang/lib/Parse/ParseStmt.cpp
index e6f8260dcd9fdf..110806ef0c77d6 100644
--- a/clang/lib/Parse/ParseStmt.cpp
+++ b/clang/lib/Parse/ParseStmt.cpp
@@ -1076,7 +1076,7 @@ void Parser::DiagnoseLabelAtEndOfCompoundStatement() {
: diag::ext_cxx_label_end_of_compound_statement);
} else {
Diag(Tok, getLangOpts().C23
- ? diag::warn_c2x_compat_label_end_of_compound_statement
+ ? diag::warn_c23_compat_label_end_of_compound_statement
: diag::ext_c_label_end_of_compound_statement);
}
}
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp
index a73d8770779860..09696ee73ca38c 100644
--- a/clang/lib/Sema/SemaChecking.cpp
+++ b/clang/lib/Sema/SemaChecking.cpp
@@ -16747,7 +16747,7 @@ bool Sema::CheckParmsForFunctionDef(ArrayRef<ParmVarDecl *> Parameters,
!Param->isImplicit() && !getLangOpts().CPlusPlus) {
// Diagnose this as an extension in C17 and earlier.
if (!getLangOpts().C23)
- Diag(Param->getLocation(), diag::ext_parameter_name_omitted_c2x);
+ Diag(Param->getLocation(), diag::ext_parameter_name_omitted_c23);
}
// C99 6.7.5.3p12:
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index d413b8109c8b04..72e3b01cfea04a 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -4121,8 +4121,8 @@ ExprResult Sema::ActOnNumericConstant(const Token &Tok, Scope *UDLScope) {
// type such as std::bit_int instead of returning a _BitInt.
if (Literal.isBitInt && !getLangOpts().CPlusPlus)
PP.Diag(Tok.getLocation(), getLangOpts().C23
- ? diag::warn_c2x_compat_bitint_suffix
- : diag::ext_c2x_bitint_suffix);
+ ? diag::warn_c23_compat_bitint_suffix
+ : diag::ext_c23_bitint_suffix);
// Get the value in the widest-possible width. What is "widest" depends on
// whether the literal is a bit-precise integer or not. For a bit-precise
@@ -16993,7 +16993,7 @@ void Sema::ActOnBlockArguments(SourceLocation CaretLoc, Declarator &ParamInfo,
!Param->isInvalidDecl() && !getLangOpts().CPlusPlus) {
// Diagnose this as an extension in C17 and earlier.
if (!getLangOpts().C23)
- Diag(Param->getLocation(), diag::ext_parameter_name_omitted_c2x);
+ Diag(Param->getLocation(), diag::ext_parameter_name_omitted_c23);
}
Params.push_back(Param);
}
diff --git a/clang/test/Analysis/region-store.c b/clang/test/Analysis/region-store.c
index 568bcd719a7075..e58b5bb078fa75 100644
--- a/clang/test/Analysis/region-store.c
+++ b/clang/test/Analysis/region-store.c
@@ -60,9 +60,9 @@ void testConstraintOnRegionOffsetStack(int *values, int length, int i) {
}
int buffer[10];
-void b(); // expected-warning {{a function declaration without a prototype is deprecated in all versions of C and is treated as a zero-parameter prototype in C2x, conflicting with a subsequent definition}}
+void b(); // expected-warning {{a function declaration without a prototype is deprecated in all versions of C and is treated as a zero-parameter prototype in C23, conflicting with a subsequent definition}}
void missingPrototypeCallsiteMatchingArgsAndParams() {
- // expected-warning at +1 {{passing arguments to 'b' without a prototype is deprecated in all versions of C and is not supported in C2x}}
+ // expected-warning at +1 {{passing arguments to 'b' without a prototype is deprecated in all versions of C and is not supported in C23}}
b(&buffer);
}
void b(int *c) { // expected-note {{conflicting prototype is here}}
@@ -70,9 +70,9 @@ void b(int *c) { // expected-note {{conflicting prototype is here}}
*c = 42; // no-crash
}
-void c(); // expected-warning {{a function declaration without a prototype is deprecated in all versions of C and is treated as a zero-parameter prototype in C2x, conflicting with a subsequent definition}}
+void c(); // expected-warning {{a function declaration without a prototype is deprecated in all versions of C and is treated as a zero-parameter prototype in C23, conflicting with a subsequent definition}}
void missingPrototypeCallsiteMismatchingArgsAndParams() {
- // expected-warning at +1 {{passing arguments to 'c' without a prototype is deprecated in all versions of C and is not supported in C2x}}
+ // expected-warning at +1 {{passing arguments to 'c' without a prototype is deprecated in all versions of C and is not supported in C23}}
c(&buffer, &buffer);
}
void c(int *c) { // expected-note {{conflicting prototype is here}}
diff --git a/clang/test/C/C11/n1330.c b/clang/test/C/C11/n1330.c
index 4e6d18d036d38e..153f1994192dde 100644
--- a/clang/test/C/C11/n1330.c
+++ b/clang/test/C/C11/n1330.c
@@ -9,13 +9,13 @@
// extension that allows you to elide the second argument.
int a;
_Static_assert(a, ""); // expected-error {{static assertion expression is not an integral constant expression}}
-_Static_assert(1); // expected-warning {{'_Static_assert' with no message is a C2x extension}}
+_Static_assert(1); // expected-warning {{'_Static_assert' with no message is a C23 extension}}
// Test functional requirements
_Static_assert(1, "this works");
_Static_assert(0, "this fails"); // expected-error {{static assertion failed: this fails}}
_Static_assert(0); // expected-error {{static assertion failed}} \
- expected-warning {{'_Static_assert' with no message is a C2x extension}}
+ expected-warning {{'_Static_assert' with no message is a C23 extension}}
// Test declaration contexts. We've already demonstrated that file scope works.
struct S {
@@ -66,7 +66,7 @@ void test(void) {
// The error about expecting a ';' is due to the static assertion confusing the
// compiler. It'd be nice if we improved the diagnostics here, but because this
// involves a K&R C declaration, it's low priority.
-void knr(a, b, c) // expected-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C2x}}
+void knr(a, b, c) // expected-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C23}}
int a, b; // expected-error {{expected ';' at end of declaration}}
_Static_assert(1, "this should not compile"); // expected-error {{expected identifier or '('}} \
expected-error {{type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int}}
diff --git a/clang/test/C/C2x/n2607.c b/clang/test/C/C2x/n2607.c
index 763cfd9253cf27..9595aaed54c437 100644
--- a/clang/test/C/C2x/n2607.c
+++ b/clang/test/C/C2x/n2607.c
@@ -14,7 +14,7 @@ void matrix_fun(int N, const float x[N][N]);
void test1(void) {
int N = 100;
float x[N][N];
- // FIXME: This is OK in C2x but should be diagnosed as passing incompatible
+ // FIXME: This is OK in C23 but should be diagnosed as passing incompatible
// pointer types in C17 and earlier.
matrix_fun(N, x);
}
diff --git a/clang/test/C/C2x/n2900_n3011.c b/clang/test/C/C2x/n2900_n3011.c
index 6aaff3374c1688..4350aa140691b1 100644
--- a/clang/test/C/C2x/n2900_n3011.c
+++ b/clang/test/C/C2x/n2900_n3011.c
@@ -9,12 +9,12 @@
* Consistent, Warningless, and Intuitive Initialization with {}
*/
void test(void) {
- struct S { int x, y; } s = {}; // compat-warning {{use of an empty initializer is incompatible with C standards before C2x}} \
- pedantic-warning {{use of an empty initializer is a C2x extension}}
- int i = {}; // compat-warning {{use of an empty initializer is incompatible with C standards before C2x}} \
- pedantic-warning {{use of an empty initializer is a C2x extension}}
- int j = (int){}; // compat-warning {{use of an empty initializer is incompatible with C standards before C2x}} \
- pedantic-warning {{use of an empty initializer is a C2x extension}}
+ struct S { int x, y; } s = {}; // compat-warning {{use of an empty initializer is incompatible with C standards before C23}} \
+ pedantic-warning {{use of an empty initializer is a C23 extension}}
+ int i = {}; // compat-warning {{use of an empty initializer is incompatible with C standards before C23}} \
+ pedantic-warning {{use of an empty initializer is a C23 extension}}
+ int j = (int){}; // compat-warning {{use of an empty initializer is incompatible with C standards before C23}} \
+ pedantic-warning {{use of an empty initializer is a C23 extension}}
// C2x 6.7.10p4 says, in part: An array of unknown size shall not be
// initialized by an empty initializer.
@@ -23,38 +23,38 @@ void test(void) {
// that we support empty initialization of an unbounded array in C++, we also
// support it in C.
int unknown_size[] = {}; // pedantic-warning {{zero size arrays are an extension}} \
- pedantic-warning {{use of an empty initializer is a C2x extension}} \
- compat-warning {{use of an empty initializer is incompatible with C standards before C2x}}
- int vla[i] = {}; // compat-warning {{use of an empty initializer is incompatible with C standards before C2x}} \
- pedantic-warning {{use of an empty initializer is a C2x extension}}
- int *compound_literal_vla = (int[i]){}; // compat-warning {{use of an empty initializer is incompatible with C standards before C2x}} \
- pedantic-warning {{use of an empty initializer is a C2x extension}}
+ pedantic-warning {{use of an empty initializer is a C23 extension}} \
+ compat-warning {{use of an empty initializer is incompatible with C standards before C23}}
+ int vla[i] = {}; // compat-warning {{use of an empty initializer is incompatible with C standards before C23}} \
+ pedantic-warning {{use of an empty initializer is a C23 extension}}
+ int *compound_literal_vla = (int[i]){}; // compat-warning {{use of an empty initializer is incompatible with C standards before C23}} \
+ pedantic-warning {{use of an empty initializer is a C23 extension}}
struct T {
int i;
struct S s;
- } t1 = { 1, {} }; // compat-warning {{use of an empty initializer is incompatible with C standards before C2x}} \
- pedantic-warning {{use of an empty initializer is a C2x extension}}
+ } t1 = { 1, {} }; // compat-warning {{use of an empty initializer is incompatible with C standards before C23}} \
+ pedantic-warning {{use of an empty initializer is a C23 extension}}
struct T t2 = {
1, {
- 2, {} // compat-warning {{use of an empty initializer is incompatible with C standards before C2x}} \
- pedantic-warning {{use of an empty initializer is a C2x extension}}
+ 2, {} // compat-warning {{use of an empty initializer is incompatible with C standards before C23}} \
+ pedantic-warning {{use of an empty initializer is a C23 extension}}
}
};
struct T t3 = {
- (int){}, // compat-warning {{use of an empty initializer is incompatible with C standards before C2x}} \
- pedantic-warning {{use of an empty initializer is a C2x extension}}
- {} // compat-warning {{use of an empty initializer is incompatible with C standards before C2x}} \
- pedantic-warning {{use of an empty initializer is a C2x extension}}
+ (int){}, // compat-warning {{use of an empty initializer is incompatible with C standards before C23}} \
+ pedantic-warning {{use of an empty initializer is a C23 extension}}
+ {} // compat-warning {{use of an empty initializer is incompatible with C standards before C23}} \
+ pedantic-warning {{use of an empty initializer is a C23 extension}}
};
// Ensure that zero initialization does what you'd expect in a constant expr.
// FIXME: the "not an ICE" warning is incorrect for C2x, but we don't yet
// implement WG14 N3038.
- _Static_assert((int){} == 0, "what?"); // compat-warning {{use of an empty initializer is incompatible with C standards before C2x}} \
- pedantic-warning {{use of an empty initializer is a C2x extension}} \
+ _Static_assert((int){} == 0, "what?"); // compat-warning {{use of an empty initializer is incompatible with C standards before C23}} \
+ pedantic-warning {{use of an empty initializer is a C23 extension}} \
pedantic-warning {{expression is not an integer constant expression; folding it to a constant is a GNU extension}}
}
diff --git a/clang/test/C/C2x/n2934.c b/clang/test/C/C2x/n2934.c
index d967446d8465a3..a5ee09d031914e 100644
--- a/clang/test/C/C2x/n2934.c
+++ b/clang/test/C/C2x/n2934.c
@@ -5,18 +5,18 @@
* Revise spelling of keywords v7
*/
-thread_local struct alignas(int) S { // c2x-warning {{'alignas' is incompatible with C standards before C2x}} \
- c2x-warning {{'thread_local' is incompatible with C standards before C2x}} \
+thread_local struct alignas(int) S { // c2x-warning {{'alignas' is incompatible with C standards before C23}} \
+ c2x-warning {{'thread_local' is incompatible with C standards before C23}} \
c2x-error 0+ {{thread-local storage is not supported for the current target}} \
c17-error {{unknown type name 'thread_local'}} \
c17-error {{expected identifier or '('}} \
c17-error {{expected ')'}} \
c17-note {{to match this '('}}
- bool b; // c2x-warning {{'bool' is incompatible with C standards before C2x}}
+ bool b; // c2x-warning {{'bool' is incompatible with C standards before C23}}
} s; // c17-error {{type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int}}
-static_assert(alignof(struct S) == alignof(int), ""); // c2x-warning {{'static_assert' is incompatible with C standards before C2x}} \
- c2x-warning 2 {{'alignof' is incompatible with C standards before C2x}} \
+static_assert(alignof(struct S) == alignof(int), ""); // c2x-warning {{'static_assert' is incompatible with C standards before C23}} \
+ c2x-warning 2 {{'alignof' is incompatible with C standards before C23}} \
c17-error 2 {{type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int}} \
c17-error {{expected ')'}} \
c17-warning {{declaration of 'struct S' will not be visible outside of this function}} \
diff --git a/clang/test/C/C2x/n2975.c b/clang/test/C/C2x/n2975.c
index f5b94c256d00f6..5fc641dd66e781 100644
--- a/clang/test/C/C2x/n2975.c
+++ b/clang/test/C/C2x/n2975.c
@@ -8,8 +8,8 @@
#define DERP this is an error
-void func(...) { // expected-warning {{'...' as the only parameter of a function is incompatible with C standards before C2x}}
- // Show that va_start doesn't require the second argument in C2x mode.
+void func(...) { // expected-warning {{'...' as the only parameter of a function is incompatible with C standards before C23}}
+ // Show that va_start doesn't require the second argument in C23 mode.
va_list list;
va_start(list); // FIXME: it would be nice to issue a portability warning to C17 and earlier here.
va_end(list);
@@ -32,7 +32,7 @@ void func(...) { // expected-warning {{'...' as the only parameter of a function
// Show that function pointer types also don't need an argument before the
// ellipsis.
-typedef void (*fp)(...); // expected-warning {{'...' as the only parameter of a function is incompatible with C standards before C2x}}
+typedef void (*fp)(...); // expected-warning {{'...' as the only parameter of a function is incompatible with C standards before C23}}
// Passing something other than the argument before the ... is still not valid.
void diag(int a, int b, ...) {
@@ -41,7 +41,7 @@ void diag(int a, int b, ...) {
// to __builtin_va_start. However, because va_start is not allowed to expand
// or evaluate the second argument, we can't pass it along to
// __builtin_va_start to get that diagnostic. So in C17 and earlier, we will
- // diagnose this use through the macro, but in C2x and later we've lost the
+ // diagnose this use through the macro, but in C23 and later we've lost the
// diagnostic entirely. GCC has the same issue currently.
va_start(list, a);
// However, the builtin itself is under no such constraints regarding
diff --git a/clang/test/C/drs/dr0xx.c b/clang/test/C/drs/dr0xx.c
index 9eb626397b6e07..d9c1fbe4ee40ab 100644
--- a/clang/test/C/drs/dr0xx.c
+++ b/clang/test/C/drs/dr0xx.c
@@ -238,13 +238,13 @@ int dr032 = (1, 2); /* expected-warning {{left operand of comma operator has no
/* WG14 DR035: partial
* Questions about definition of functions without a prototype
*/
-void dr035_1(a, b) /* expected-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C2x}} */
+void dr035_1(a, b) /* expected-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C23}} */
int a(enum b {x, y}); /* expected-warning {{declaration of 'enum b' will not be visible outside of this function}} */
int b; {
int test = x; /* expected-error {{use of undeclared identifier 'x'}} */
}
-void dr035_2(c) /* expected-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C2x}} */
+void dr035_2(c) /* expected-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C23}} */
enum m{q, r} c; { /* expected-warning {{declaration of 'enum m' will not be visible outside of this function}} */
/* FIXME: This should be accepted because the scope of m, q, and r ends at
* the closing brace of the function per C89 6.1.2.1.
@@ -352,9 +352,9 @@ void dr053(void) {
fp1 = f;
fp2 = fp1;
- (*fp2)(3); /* expected-warning {{passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x}} */
+ (*fp2)(3); /* expected-warning {{passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C23}} */
fpp = &fp1;
- (**fpp)(3); /* expected-warning {{passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x}} */
+ (**fpp)(3); /* expected-warning {{passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C23}} */
}
#endif /* __STDC_VERSION__ < 202311L */
@@ -398,7 +398,7 @@ void dr068(void) {
* a prototype causes implicit conversions rather than relying on default
* argument promotion and warm thoughts.
*/
-void dr070_1(c) /* expected-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C2x}} */
+void dr070_1(c) /* expected-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C23}} */
int c; {
}
diff --git a/clang/test/C/drs/dr2xx.c b/clang/test/C/drs/dr2xx.c
index 1aa8db504d61ce..9c8d77518ab55e 100644
--- a/clang/test/C/drs/dr2xx.c
+++ b/clang/test/C/drs/dr2xx.c
@@ -247,7 +247,7 @@ void dr252(void) {
* prototype, but Clang treats it as an error.
*/
dr252_no_proto(dr252_proto()); /* expected-error {{argument type 'void' is incomplete}}
- expected-warning {{passing arguments to 'dr252_no_proto' without a prototype is deprecated in all versions of C and is not supported in C2x}}
+ expected-warning {{passing arguments to 'dr252_no_proto' without a prototype is deprecated in all versions of C and is not supported in C23}}
*/
}
#endif /* __STDC_VERSION__ < 202311L */
diff --git a/clang/test/C/drs/dr3xx.c b/clang/test/C/drs/dr3xx.c
index 9493e95123ed24..4d6617184d9a4b 100644
--- a/clang/test/C/drs/dr3xx.c
+++ b/clang/test/C/drs/dr3xx.c
@@ -118,7 +118,7 @@ _Static_assert(sizeof(dr315.c + dr315.d) == sizeof(int), "");
/* WG14 DR316: yes
* Unprototyped function types
*/
-void dr316_1(a) int a; {} /* expected-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C2x}} */
+void dr316_1(a) int a; {} /* expected-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C23}} */
void (*dr316_1_ptr)(int, int, int) = dr316_1;
/* WG14 DR317: yes
@@ -134,7 +134,7 @@ void dr317_1() {} /* expected-warning {{a function declaration without a protot
void dr317_2(void) {
if (0)
dr317_1(1); /* expected-warning {{too many arguments in call to 'dr317_1'}}
- expected-warning {{passing arguments to 'dr317_1' without a prototype is deprecated in all versions of C and is not supported in C2x}}
+ expected-warning {{passing arguments to 'dr317_1' without a prototype is deprecated in all versions of C and is not supported in C23}}
*/
}
#endif /* __STDC_VERSION__ < 202311L */
diff --git a/clang/test/C/drs/dr4xx.c b/clang/test/C/drs/dr4xx.c
index 5c5349aa7c1409..b8ccceaad12c59 100644
--- a/clang/test/C/drs/dr4xx.c
+++ b/clang/test/C/drs/dr4xx.c
@@ -301,7 +301,7 @@ void dr489(void) {
switch (i) {
case (int)0.0f: break; /* okay, a valid ICE */
- /* FIXME: this should be accepted in C2x and up without a diagnostic, as C23
+ /* FIXME: this should be accepted in C23 and up without a diagnostic, as C23
* added compound literals to the allowed list of things in an ICE. The
* diagnostic is correct for C17 and earlier though.
*/
diff --git a/clang/test/CodeGen/2009-06-01-addrofknr.c b/clang/test/CodeGen/2009-06-01-addrofknr.c
index 905c696721ca72..c769b63bf7f0e8 100644
--- a/clang/test/CodeGen/2009-06-01-addrofknr.c
+++ b/clang/test/CodeGen/2009-06-01-addrofknr.c
@@ -5,7 +5,7 @@ struct funcptr {
int (*func)();
};
-static int func(f) // expected-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C2x}}
+static int func(f) // expected-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C23}}
void *f;
{
return 0;
diff --git a/clang/test/Lexer/Inputs/unsafe-macro-2.h b/clang/test/Lexer/Inputs/unsafe-macro-2.h
index e7254bc007a56c..abec80477d7391 100644
--- a/clang/test/Lexer/Inputs/unsafe-macro-2.h
+++ b/clang/test/Lexer/Inputs/unsafe-macro-2.h
@@ -40,7 +40,7 @@ const int z = UNSAFE_MACRO_2;
#ifdef baz
#elifdef UNSAFE_MACRO
// expected-warning at -1{{macro 'UNSAFE_MACRO' has been marked as unsafe for use in headers: Don't use this!}}
-// expected-warning at -2{{use of a '#elifdef' directive is a C2x extension}}
+// expected-warning at -2{{use of a '#elifdef' directive is a C23 extension}}
#endif
// Test that we diagnose on #elifndef.
@@ -48,7 +48,7 @@ const int z = UNSAFE_MACRO_2;
#elifndef UNSAFE_MACRO
#endif
// expected-warning at -2{{macro 'UNSAFE_MACRO' has been marked as unsafe for use in headers: Don't use this!}}
-// expected-warning at -3{{use of a '#elifndef' directive is a C2x extension}}
+// expected-warning at -3{{use of a '#elifndef' directive is a C23 extension}}
// FIXME: These cases are currently not handled because clang doesn't expand
// conditions on skipped #elif* blocks. See the FIXME notes in
@@ -58,13 +58,13 @@ const int z = UNSAFE_MACRO_2;
#ifdef frobble
// not-expected-warning at +2{{macro 'UNSAFE_MACRO' has been marked as unsafe for use in headers: Don't use this!}}
-// expected-warning at +1{{use of a '#elifndef' directive is a C2x extension}}
+// expected-warning at +1{{use of a '#elifndef' directive is a C23 extension}}
#elifndef UNSAFE_MACRO
#endif
#ifdef frobble
// not-expected-warning at +2{{macro 'UNSAFE_MACRO' has been marked as unsafe for use in headers: Don't use this!}}
-// expected-warning at +1{{use of a '#elifdef' directive is a C2x extension}}
+// expected-warning at +1{{use of a '#elifdef' directive is a C23 extension}}
#elifdef UNSAFE_MACRO
#endif
diff --git a/clang/test/Lexer/bitint-constants-compat.c b/clang/test/Lexer/bitint-constants-compat.c
index 6429c3c1739125..607ae88a6188bb 100644
--- a/clang/test/Lexer/bitint-constants-compat.c
+++ b/clang/test/Lexer/bitint-constants-compat.c
@@ -2,13 +2,13 @@
// RUN: %clang_cc1 -std=c2x -fsyntax-only -verify=compat -Wpre-c2x-compat -Wno-unused %s
// RUN: %clang_cc1 -fsyntax-only -verify=cpp -Wno-unused -x c++ %s
-#if 18446744073709551615uwb // ext-warning {{'_BitInt' suffix for literals is a C2x extension}} \
- compat-warning {{'_BitInt' suffix for literals is incompatible with C standards before C2x}} \
+#if 18446744073709551615uwb // ext-warning {{'_BitInt' suffix for literals is a C23 extension}} \
+ compat-warning {{'_BitInt' suffix for literals is incompatible with C standards before C23}} \
cpp-error {{invalid suffix 'uwb' on integer constant}}
#endif
void func(void) {
- 18446744073709551615wb; // ext-warning {{'_BitInt' suffix for literals is a C2x extension}} \
- compat-warning {{'_BitInt' suffix for literals is incompatible with C standards before C2x}} \
+ 18446744073709551615wb; // ext-warning {{'_BitInt' suffix for literals is a C23 extension}} \
+ compat-warning {{'_BitInt' suffix for literals is incompatible with C standards before C23}} \
cpp-error {{invalid suffix 'wb' on integer constant}}
}
diff --git a/clang/test/Lexer/deprecate-macro.c b/clang/test/Lexer/deprecate-macro.c
index 1f08093b17a4ec..a834d72220decf 100644
--- a/clang/test/Lexer/deprecate-macro.c
+++ b/clang/test/Lexer/deprecate-macro.c
@@ -79,7 +79,7 @@ int main(int argc, char** argv) {
#ifdef baz
#elifdef foo
// expected-warning at -1{{macro 'foo' has been marked as deprecated}}
-// expected-warning at -2{{use of a '#elifdef' directive is a C2x extension}}
+// expected-warning at -2{{use of a '#elifdef' directive is a C23 extension}}
#endif
// Test that we diagnose on #elifndef.
@@ -87,7 +87,7 @@ int main(int argc, char** argv) {
#elifndef foo
#endif
// expected-warning at -2{{macro 'foo' has been marked as deprecated}}
-// expected-warning at -3{{use of a '#elifndef' directive is a C2x extension}}
+// expected-warning at -3{{use of a '#elifndef' directive is a C23 extension}}
// FIXME: These cases are currently not handled because clang doesn't expand
// conditions on skipped #elif* blocks. See the FIXME notes in
@@ -95,13 +95,13 @@ int main(int argc, char** argv) {
#ifdef frobble
// not-expected-warning at +2{{macro 'foo' has been marked as deprecated}}
-// expected-warning at +1{{use of a '#elifndef' directive is a C2x extension}}
+// expected-warning at +1{{use of a '#elifndef' directive is a C23 extension}}
#elifndef foo
#endif
#ifdef frobble
// not-expected-warning at +2{{macro 'foo' has been marked as deprecated}}
-// expected-warning at +1{{use of a '#elifdef' directive is a C2x extension}}
+// expected-warning at +1{{use of a '#elifdef' directive is a C23 extension}}
#elifdef foo
#endif
diff --git a/clang/test/Lexer/keywords_test.c b/clang/test/Lexer/keywords_test.c
index b093f9743a2aeb..466ed8235445a8 100644
--- a/clang/test/Lexer/keywords_test.c
+++ b/clang/test/Lexer/keywords_test.c
@@ -93,13 +93,13 @@ void has_static_assert();
int restrict; // c89-warning {{'restrict' is a keyword in C99}}
int inline; // c89-warning {{'inline' is a keyword in C99}}
- int bool; // c89-warning {{'bool' is a keyword in C2x}}
- char true; // c89-warning {{'true' is a keyword in C2x}}
- char false; // c89-warning {{'false' is a keyword in C2x}}
- float alignof; // c89-warning {{'alignof' is a keyword in C2x}}
- int typeof; // c89-warning {{'typeof' is a keyword in C2x}}
- int typeof_unqual; // c89-warning {{'typeof_unqual' is a keyword in C2x}}
- int alignas; // c89-warning {{'alignas' is a keyword in C2x}}
- int static_assert; // c89-warning {{'static_assert' is a keyword in C2x}}
+ int bool; // c89-warning {{'bool' is a keyword in C23}}
+ char true; // c89-warning {{'true' is a keyword in C23}}
+ char false; // c89-warning {{'false' is a keyword in C23}}
+ float alignof; // c89-warning {{'alignof' is a keyword in C23}}
+ int typeof; // c89-warning {{'typeof' is a keyword in C23}}
+ int typeof_unqual; // c89-warning {{'typeof_unqual' is a keyword in C23}}
+ int alignas; // c89-warning {{'alignas' is a keyword in C23}}
+ int static_assert; // c89-warning {{'static_assert' is a keyword in C23}}
#endif
diff --git a/clang/test/Parser/c2x-func-prototype.c b/clang/test/Parser/c2x-func-prototype.c
index 2602fa8195eaa4..f2a8b8d8bd0944 100644
--- a/clang/test/Parser/c2x-func-prototype.c
+++ b/clang/test/Parser/c2x-func-prototype.c
@@ -2,7 +2,7 @@
// RUN: %clang_cc1 -Wno-strict-prototypes -fsyntax-only -verify -std=c17 %s
// expected-no-diagnostics
-// Functions with an identifier list are not supported in C2x.
+// Functions with an identifier list are not supported in C23.
void ident_list(a) // c2x-error {{expected ';' after top level declarator}} \
c2x-error {{unknown type name 'a'}}
int a;
diff --git a/clang/test/Parser/c2x-label.c b/clang/test/Parser/c2x-label.c
index 8e276c05254e38..f7fcd6e524637c 100644
--- a/clang/test/Parser/c2x-label.c
+++ b/clang/test/Parser/c2x-label.c
@@ -6,8 +6,8 @@ void test_label_in_func() {
label1:
x = 1;
label2: label3: label4:
-} // c17-warning {{label at end of compound statement is a C2x extension}} \
- c2x-warning {{label at end of compound statement is incompatible with C standards before C2x}}
+} // c17-warning {{label at end of compound statement is a C23 extension}} \
+ c2x-warning {{label at end of compound statement is incompatible with C standards before C23}}
int test_label_in_switch(int v) {
switch (v) {
@@ -16,15 +16,15 @@ int test_label_in_switch(int v) {
case 2:
return 2;
case 3: case 4: case 5:
- } // c17-warning {{label at end of compound statement is a C2x extension}} \
- c2x-warning {{label at end of compound statement is incompatible with C standards before C2x}}
+ } // c17-warning {{label at end of compound statement is a C23 extension}} \
+ c2x-warning {{label at end of compound statement is incompatible with C standards before C23}}
switch (v) {
case 6:
return 6;
default:
- } // c17-warning {{label at end of compound statement is a C2x extension}} \
- c2x-warning {{label at end of compound statement is incompatible with C standards before C2x}}
+ } // c17-warning {{label at end of compound statement is a C23 extension}} \
+ c2x-warning {{label at end of compound statement is incompatible with C standards before C23}}
return 0;
}
diff --git a/clang/test/Parser/c2x-typeof-ext-warns.c b/clang/test/Parser/c2x-typeof-ext-warns.c
index 1c382d3d2f9484..387184497bd2eb 100644
--- a/clang/test/Parser/c2x-typeof-ext-warns.c
+++ b/clang/test/Parser/c2x-typeof-ext-warns.c
@@ -9,7 +9,7 @@
// Exercise the various circumstances under which we will diagnose use of
// typeof and typeof_unqual as either an extension or as a compatability
// warning. Note that GCC exposes 'typeof' as a non-conforming extension in
-// standards before C2x, and Clang has followed suit. Neither compiler exposes
+// standards before C23, and Clang has followed suit. Neither compiler exposes
// 'typeof_unqual' as a non-conforming extension.
// Show what happens with the underscored version of the keyword, which is a
@@ -19,11 +19,11 @@ __typeof__(int) i = 12;
// Show what happens with a regular 'typeof' use.
typeof(i) j = 12; // c11-error {{expected function body after function declarator}} \
pedantic-warning {{extension used}} \
- compat-warning {{'typeof' is incompatible with C standards before C2x}}
+ compat-warning {{'typeof' is incompatible with C standards before C23}}
// Same for 'typeof_unqual'.
typeof_unqual(j) k = 12; // c11-error {{expected function body after function declarator}} \
gnu11-error {{expected function body after function declarator}} \
pedantic-error {{expected function body after function declarator}} \
- compat-warning {{'typeof_unqual' is incompatible with C standards before C2x}}
+ compat-warning {{'typeof_unqual' is incompatible with C standards before C23}}
diff --git a/clang/test/Parser/declarators.c b/clang/test/Parser/declarators.c
index 3af09817e6b63f..08c5df9f6071b6 100644
--- a/clang/test/Parser/declarators.c
+++ b/clang/test/Parser/declarators.c
@@ -27,12 +27,12 @@ void test2(int *P, int A) {
}
typedef int atype;
-void test3(x, /* expected-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C2x}} */
+void test3(x, /* expected-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C23}} */
atype /* expected-error {{unexpected type name 'atype': expected identifier}} */
) int x, atype; {}
void test4(x, x) int x; {} // expected-error {{redefinition of parameter 'x'}} \
- // expected-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C2x}}
+ // expected-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C23}}
// PR3031
@@ -99,11 +99,11 @@ void *test14b = (void*)test14a; // Make sure test14a didn't get skipped.
long struct X { int x; } test15(void); // expected-error {{'long struct' is invalid}}
void test16(i) int i j; { } // expected-error {{expected ';' at end of declaration}} \
- // expected-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C2x}}
+ // expected-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C23}}
void test17(i, j) int i, j k; { } // expected-error {{expected ';' at end of declaration}} \
- // expected-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C2x}}
+ // expected-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C23}}
void knrNoSemi(i) int i { } // expected-error {{expected ';' at end of declaration}} \
- // expected-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C2x}}
+ // expected-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C23}}
// PR12595
void test18(void) {
diff --git a/clang/test/Parser/static_assert.c b/clang/test/Parser/static_assert.c
index 08b2c37f8afe58..e9d7d3f0833f3d 100644
--- a/clang/test/Parser/static_assert.c
+++ b/clang/test/Parser/static_assert.c
@@ -15,7 +15,7 @@
// Only test the C++ spelling in C mode in some of the tests, to reduce the
// amount of diagnostics to have to check. This spelling is allowed in MS-
// compatibility mode in C, but otherwise produces errors.
-static_assert(1, ""); // c17-warning {{'static_assert' is a keyword in C2x}} \
+static_assert(1, ""); // c17-warning {{'static_assert' is a keyword in C23}} \
// c17-error {{expected parameter declarator}} \
// c17-error {{expected ')'}} \
// c17-note {{to match this '('}} \
@@ -36,14 +36,14 @@ _Static_assert(1, ""); // c99-pedantic-warning {{'_Static_assert' is a C11 exten
// older standards.
// * In older standard pedantic modes, warn about supporting without a
// message as an extension.
-_Static_assert(1); // c99-pedantic-warning {{'_Static_assert' with no message is a C2x extension}} \
- // c99-warning {{'_Static_assert' with no message is a C2x extension}} \
+_Static_assert(1); // c99-pedantic-warning {{'_Static_assert' with no message is a C23 extension}} \
+ // c99-warning {{'_Static_assert' with no message is a C23 extension}} \
// cxx98-pedantic-warning {{'static_assert' with no message is a C++17 extension}} \
// cxx98-warning {{'static_assert' with no message is a C++17 extension}} \
- // c2x-compat-warning {{'_Static_assert' with no message is incompatible with C standards before C2x}} \
+ // c2x-compat-warning {{'_Static_assert' with no message is incompatible with C standards before C23}} \
// cxx17-compat-warning {{'static_assert' with no message is incompatible with C++ standards before C++17}} \
// c99-pedantic-warning {{'_Static_assert' is a C11 extension}} \
// cxx17-pedantic-warning {{'_Static_assert' is a C11 extension}} \
// cxx98-pedantic-warning {{'_Static_assert' is a C11 extension}} \
- // c17-warning {{'_Static_assert' with no message is a C2x extension}} \
- // c17-ms-warning {{'_Static_assert' with no message is a C2x extension}}
+ // c17-warning {{'_Static_assert' with no message is a C23 extension}} \
+ // c17-ms-warning {{'_Static_assert' with no message is a C23 extension}}
diff --git a/clang/test/Preprocessor/elifdef.c b/clang/test/Preprocessor/elifdef.c
index 900d21e6548e05..419e2297a18178 100644
--- a/clang/test/Preprocessor/elifdef.c
+++ b/clang/test/Preprocessor/elifdef.c
@@ -1,13 +1,13 @@
// RUN: %clang_cc1 %s -Eonly -verify
-/* expected-warning at +2 {{use of a '#elifdef' directive is a C2x extension}} */
+/* expected-warning at +2 {{use of a '#elifdef' directive is a C23 extension}} */
#ifdef FOO
#elifdef BAR
#error "did not expect to get here"
#endif
/* expected-error at +5 {{"got it"}} */
-/* expected-warning at +2 {{use of a '#elifdef' directive is a C2x extension}} */
+/* expected-warning at +2 {{use of a '#elifdef' directive is a C23 extension}} */
#ifdef FOO
#elifdef BAR
#else
@@ -15,14 +15,14 @@
#endif
/* expected-error at +4 {{"got it"}} */
-/* expected-warning at +2 {{use of a '#elifndef' directive is a C2x extension}} */
+/* expected-warning at +2 {{use of a '#elifndef' directive is a C23 extension}} */
#ifdef FOO
#elifndef BAR
#error "got it"
#endif
/* expected-error at +4 {{"got it"}} */
-/* expected-warning at +2 {{use of a '#elifndef' directive is a C2x extension}} */
+/* expected-warning at +2 {{use of a '#elifndef' directive is a C23 extension}} */
#ifdef FOO
#elifndef BAR
#error "got it"
@@ -32,21 +32,21 @@
#define BAR
/* expected-error at +4 {{"got it"}} */
-/* expected-warning at +2 {{use of a '#elifdef' directive is a C2x extension}} */
+/* expected-warning at +2 {{use of a '#elifdef' directive is a C23 extension}} */
#ifdef FOO
#elifdef BAR
#error "got it"
#endif
#undef BAR
-/* expected-warning at +2 {{use of a '#elifdef' directive is a C2x extension}} */
+/* expected-warning at +2 {{use of a '#elifdef' directive is a C23 extension}} */
#ifdef FOO
#elifdef BAR // test that comments aren't an issue
#error "did not expect to get here"
#endif
/* expected-error at +5 {{"got it"}} */
-/* expected-warning at +2 {{use of a '#elifdef' directive is a C2x extension}} */
+/* expected-warning at +2 {{use of a '#elifdef' directive is a C23 extension}} */
#ifdef FOO
#elifdef BAR // test that comments aren't an issue
#else
@@ -54,14 +54,14 @@
#endif
/* expected-error at +4 {{"got it"}} */
-/* expected-warning at +2 {{use of a '#elifndef' directive is a C2x extension}} */
+/* expected-warning at +2 {{use of a '#elifndef' directive is a C23 extension}} */
#ifdef FOO
#elifndef BAR // test that comments aren't an issue
#error "got it"
#endif
/* expected-error at +4 {{"got it"}} */
-/* expected-warning at +2 {{use of a '#elifndef' directive is a C2x extension}} */
+/* expected-warning at +2 {{use of a '#elifndef' directive is a C23 extension}} */
#ifdef FOO
#elifndef BAR // test that comments aren't an issue
#error "got it"
@@ -71,7 +71,7 @@
#define BAR
/* expected-error at +4 {{"got it"}} */
-/* expected-warning at +2 {{use of a '#elifdef' directive is a C2x extension}} */
+/* expected-warning at +2 {{use of a '#elifdef' directive is a C23 extension}} */
#ifdef FOO
#elifdef BAR // test that comments aren't an issue
#error "got it"
@@ -80,7 +80,7 @@
#define BAR
/* expected-error at +7 {{"got it"}} */
-/* expected-warning at +3 {{use of a '#elifndef' directive is a C2x extension}} */
+/* expected-warning at +3 {{use of a '#elifndef' directive is a C23 extension}} */
#ifdef FOO
#error "did not expect to get here"
#elifndef BAR
@@ -91,32 +91,32 @@
#undef BAR
/* expected-error at +4 {{#elifdef after #else}} */
-/* expected-warning at +3 {{use of a '#elifdef' directive is a C2x extension}} */
+/* expected-warning at +3 {{use of a '#elifdef' directive is a C23 extension}} */
#ifdef FOO
#else
#elifdef BAR
#endif
/* expected-error at +4 {{#elifndef after #else}} */
-/* expected-warning at +3 {{use of a '#elifndef' directive is a C2x extension}} */
+/* expected-warning at +3 {{use of a '#elifndef' directive is a C23 extension}} */
#ifdef FOO
#else
#elifndef BAR
#endif
-/* expected-warning at +1 {{use of a '#elifdef' directive is a C2x extension}} */
+/* expected-warning at +1 {{use of a '#elifdef' directive is a C23 extension}} */
#elifdef FOO /* expected-error {{#elifdef without #if}} */
#endif /* expected-error {{#endif without #if}} */
-/* expected-warning at +1 {{use of a '#elifndef' directive is a C2x extension}} */
+/* expected-warning at +1 {{use of a '#elifndef' directive is a C23 extension}} */
#elifndef FOO /* expected-error {{#elifndef without #if}} */
#endif /* expected-error {{#endif without #if}} */
/* Note, we do not expect errors about the missing macro name in the skipped
blocks. This is consistent with #elif behavior. */
/* expected-error at +4 {{"got it"}} */
-/* expected-warning at +4 {{use of a '#elifdef' directive is a C2x extension}} */
-/* expected-warning at +4 {{use of a '#elifndef' directive is a C2x extension}} */
+/* expected-warning at +4 {{use of a '#elifdef' directive is a C23 extension}} */
+/* expected-warning at +4 {{use of a '#elifndef' directive is a C23 extension}} */
#ifndef FOO
#error "got it"
#elifdef
diff --git a/clang/test/Preprocessor/ext-pp-directive.c b/clang/test/Preprocessor/ext-pp-directive.c
index a3d74143dfbc68..0dcbb59da0b29e 100644
--- a/clang/test/Preprocessor/ext-pp-directive.c
+++ b/clang/test/Preprocessor/ext-pp-directive.c
@@ -18,8 +18,8 @@ int x;
#elifdef A // #1
#endif
// For C
-// pre-c2x-pedantic-warning@#1 {{use of a '#elifdef' directive is a C2x extension}}
-// pre-c2x-compat-warning@#1 {{use of a '#elifdef' directive is incompatible with C standards before C2x}}
+// pre-c2x-pedantic-warning@#1 {{use of a '#elifdef' directive is a C23 extension}}
+// pre-c2x-compat-warning@#1 {{use of a '#elifdef' directive is incompatible with C standards before C23}}
// For C++
// pre-cpp23-pedantic-warning@#1 {{use of a '#elifdef' directive is a C++23 extension}}
@@ -29,8 +29,8 @@ int x;
#elifndef B // #2
#endif
// For C
-// pre-c2x-pedantic-warning@#2 {{use of a '#elifndef' directive is a C2x extension}}
-// pre-c2x-compat-warning@#2 {{use of a '#elifndef' directive is incompatible with C standards before C2x}}
+// pre-c2x-pedantic-warning@#2 {{use of a '#elifndef' directive is a C23 extension}}
+// pre-c2x-compat-warning@#2 {{use of a '#elifndef' directive is incompatible with C standards before C23}}
// For C++
// pre-cpp23-pedantic-warning@#2 {{use of a '#elifndef' directive is a C++23 extension}}
@@ -40,8 +40,8 @@ int x;
#elifdef C
#endif
// For C
-// pre-c2x-pedantic-warning at -3 {{use of a '#elifdef' directive is a C2x extension}}
-// pre-c2x-compat-warning at -4 {{use of a '#elifdef' directive is incompatible with C standards before C2x}}
+// pre-c2x-pedantic-warning at -3 {{use of a '#elifdef' directive is a C23 extension}}
+// pre-c2x-compat-warning at -4 {{use of a '#elifdef' directive is incompatible with C standards before C23}}
// For C++
// pre-cpp23-pedantic-warning at -7 {{use of a '#elifdef' directive is a C++23 extension}}
@@ -51,8 +51,8 @@ int x;
#elifndef D
#endif
// For C
-// pre-c2x-pedantic-warning at -3 {{use of a '#elifndef' directive is a C2x extension}}
-// pre-c2x-compat-warning at -4 {{use of a '#elifndef' directive is incompatible with C standards before C2x}}
+// pre-c2x-pedantic-warning at -3 {{use of a '#elifndef' directive is a C23 extension}}
+// pre-c2x-compat-warning at -4 {{use of a '#elifndef' directive is incompatible with C standards before C23}}
// For C++
// pre-cpp23-pedantic-warning at -7 {{use of a '#elifndef' directive is a C++23 extension}}
@@ -60,9 +60,9 @@ int x;
#warning foo
// For C
-// pre-c2x-pedantic-warning at -2 {{#warning is a C2x extension}}
+// pre-c2x-pedantic-warning at -2 {{#warning is a C23 extension}}
// pre-c2x-pedantic-warning at -3 {{foo}}
-// pre-c2x-compat-warning at -4 {{#warning is incompatible with C standards before C2x}}
+// pre-c2x-compat-warning at -4 {{#warning is incompatible with C standards before C23}}
// pre-c2x-compat-warning at -5 {{foo}}
// For C++
diff --git a/clang/test/Preprocessor/if_warning.c b/clang/test/Preprocessor/if_warning.c
index 42c834b10aa006..fb4fe189a7fb37 100644
--- a/clang/test/Preprocessor/if_warning.c
+++ b/clang/test/Preprocessor/if_warning.c
@@ -5,7 +5,7 @@ extern int x;
#if foo // expected-error {{'foo' is not defined, evaluates to 0}}
#endif
-// expected-warning at +2 {{use of a '#elifdef' directive is a C2x extension}}
+// expected-warning at +2 {{use of a '#elifdef' directive is a C23 extension}}
#ifdef foo
#elifdef foo
#endif
@@ -15,7 +15,7 @@ extern int x;
// PR3938
-// expected-warning at +3 {{use of a '#elifdef' directive is a C2x extension}}
+// expected-warning at +3 {{use of a '#elifdef' directive is a C23 extension}}
#if 0
#ifdef D
#elifdef D
diff --git a/clang/test/Preprocessor/ifdef-recover.c b/clang/test/Preprocessor/ifdef-recover.c
index 33a53003bc2bc3..07d92a635e051f 100644
--- a/clang/test/Preprocessor/ifdef-recover.c
+++ b/clang/test/Preprocessor/ifdef-recover.c
@@ -20,13 +20,13 @@
#endif
/* expected-error at +3 {{macro name missing}} */
-/* expected-warning at +2 {{use of a '#elifdef' directive is a C2x extension}} */
+/* expected-warning at +2 {{use of a '#elifdef' directive is a C23 extension}} */
#ifdef FOO
#elifdef
#endif
/* expected-error at +3 {{macro name must be an identifier}} */
-/* expected-warning at +2 {{use of a '#elifdef' directive is a C2x extension}} */
+/* expected-warning at +2 {{use of a '#elifdef' directive is a C23 extension}} */
#ifdef FOO
#elifdef !
#endif
diff --git a/clang/test/Preprocessor/macro_misc.c b/clang/test/Preprocessor/macro_misc.c
index f80ab7144d5443..eabd6daf8c4de7 100644
--- a/clang/test/Preprocessor/macro_misc.c
+++ b/clang/test/Preprocessor/macro_misc.c
@@ -4,7 +4,7 @@
#ifdef defined
#elifdef defined
#endif
-// expected-warning at -2 {{use of a '#elifdef' directive is a C2x extension}}
+// expected-warning at -2 {{use of a '#elifdef' directive is a C23 extension}}
diff --git a/clang/test/Sema/arg-duplicate.c b/clang/test/Sema/arg-duplicate.c
index d0034cd2c777e9..32ae139bede1c2 100644
--- a/clang/test/Sema/arg-duplicate.c
+++ b/clang/test/Sema/arg-duplicate.c
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c99
-int f3(y, x, // expected-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C2x}}
+int f3(y, x, // expected-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C23}}
x) // expected-error {{redefinition of parameter}}
int y,
x, // expected-note {{previous declaration is here}}
diff --git a/clang/test/Sema/array-init.c b/clang/test/Sema/array-init.c
index 0e23a7d3d3755f..5066b326aa9ad3 100644
--- a/clang/test/Sema/array-init.c
+++ b/clang/test/Sema/array-init.c
@@ -64,7 +64,7 @@ void test(void) {
{ 2, 4, 6 },
{ 3, 5, 7 },
{ 4, 6, 8 },
- { }, // pedantic-warning{{use of an empty initializer is a C2x extension}} expected-warning{{excess elements in array initializer}}
+ { }, // pedantic-warning{{use of an empty initializer is a C23 extension}} expected-warning{{excess elements in array initializer}}
};
int y4[4][3] = {
{ 1, 3, 5, 2 }, // expected-warning{{excess elements in array initializer}}
@@ -175,7 +175,7 @@ void charArrays(void) {
char c3[5] = { "Hello" };
char c4[4] = { "Hello" }; //expected-warning{{initializer-string for char array is too long}}
- int i3[] = {}; //expected-warning{{zero size arrays are an extension}} pedantic-warning{{use of an empty initializer is a C2x extension}}
+ int i3[] = {}; //expected-warning{{zero size arrays are an extension}} pedantic-warning{{use of an empty initializer is a C23 extension}}
}
void variableArrayInit(void) {
@@ -197,7 +197,7 @@ const char r7[] = "zxcv";
char r8[5] = "5char";
char r9[5] = "6chars"; //expected-warning{{initializer-string for char array is too long}}
unsigned char r10[] = __extension__ (_Generic(0, int: (__extension__ "foo" )));
-int r11[0] = {}; //expected-warning{{zero size arrays are an extension}} pedantic-warning{{use of an empty initializer is a C2x extension}}
+int r11[0] = {}; //expected-warning{{zero size arrays are an extension}} pedantic-warning{{use of an empty initializer is a C23 extension}}
// Some struct tests
void autoStructTest(void) {
@@ -221,7 +221,7 @@ int t8[sizeof t7 == (3*sizeof(int)) ? 1 : -1];
struct bittest{int : 31, a, :21, :12, b;};
struct bittest bittestvar = {1, 2, 3, 4}; //expected-warning{{excess elements in struct initializer}}
-int u1 = {}; //pedantic-warning{{use of an empty initializer is a C2x extension}}
+int u1 = {}; //pedantic-warning{{use of an empty initializer is a C23 extension}}
int u2 = {{3}}; //expected-warning{{too many braces around scalar initializer}}
// PR2362
diff --git a/clang/test/Sema/block-args.c b/clang/test/Sema/block-args.c
index 1e000abf4b3614..19666131eb3104 100644
--- a/clang/test/Sema/block-args.c
+++ b/clang/test/Sema/block-args.c
@@ -31,8 +31,8 @@ int main(int argc, char** argv) {
// radar 7528255
void f0(void) {
- ^(int, double d, char) {}(1, 1.34, 'a'); // expected-warning {{omitting the parameter name in a function definition is a C2x extension}} \
- // expected-warning {{omitting the parameter name in a function definition is a C2x extension}}
+ ^(int, double d, char) {}(1, 1.34, 'a'); // expected-warning {{omitting the parameter name in a function definition is a C23 extension}} \
+ // expected-warning {{omitting the parameter name in a function definition is a C23 extension}}
}
// rdar://problem/8962770
diff --git a/clang/test/Sema/c2x-attr.c b/clang/test/Sema/c2x-attr.c
index dbeafb24c64b68..142bb94c28fcb6 100644
--- a/clang/test/Sema/c2x-attr.c
+++ b/clang/test/Sema/c2x-attr.c
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -fsyntax-only -std=c2x -Wpre-c2x-compat -verify=pre-c2x %s
// RUN: %clang_cc1 -fsyntax-only -std=c17 -Wc2x-extensions -verify=c2x-ext %s
-[[]] void func(); // pre-c2x-warning {{[[]] attributes are incompatible with C standards before C2x}}
- // c2x-ext-warning at -1 {{[[]] attributes are a C2x extension}}
+[[]] void func(); // pre-c2x-warning {{[[]] attributes are incompatible with C standards before C23}}
+ // c2x-ext-warning at -1 {{[[]] attributes are a C23 extension}}
diff --git a/clang/test/Sema/c2x-func-prototype.c b/clang/test/Sema/c2x-func-prototype.c
index 46bce4643ebc9c..c62c6ed3c1afcc 100644
--- a/clang/test/Sema/c2x-func-prototype.c
+++ b/clang/test/Sema/c2x-func-prototype.c
@@ -16,7 +16,7 @@ void call(void) {
fp nope = other_func; // c2x-error {{incompatible function pointer types initializing 'fp' (aka 'void (*)(void)') with an expression of type 'void (int)'}}
}
-// Ensure these function declarations do not merge in C2x.
+// Ensure these function declarations do not merge in C23.
void redecl1(); // c2x-note {{previous declaration is here}}
void redecl1(int i); // c2x-error {{conflicting types for 'redecl1'}}
diff --git a/clang/test/Sema/c2x-noreturn.c b/clang/test/Sema/c2x-noreturn.c
index 18b630de50e2c0..d94fd1baa60c04 100644
--- a/clang/test/Sema/c2x-noreturn.c
+++ b/clang/test/Sema/c2x-noreturn.c
@@ -33,7 +33,7 @@ _Noreturn void func1(void); // ok, using the function specifier
// This is deprecated because it's only for compatibility with inclusion of the
// <stdnoreturn.h> header where the noreturn macro expands to _Noreturn.
-[[_Noreturn]] void func3(void); // all-warning {{the '[[_Noreturn]]' attribute spelling is deprecated in C2x; use '[[noreturn]]' instead}}
+[[_Noreturn]] void func3(void); // all-warning {{the '[[_Noreturn]]' attribute spelling is deprecated in C23; use '[[noreturn]]' instead}}
// Test the behavior of including <stdnoreturn.h>
#include <stdnoreturn.h>
@@ -48,7 +48,7 @@ noreturn void func8(void);
void noreturn func9(void);
// Ensure that spelling the deprecated form of the attribute is still diagnosed.
-[[_Noreturn]] void func10(void); // all-warning {{the '[[_Noreturn]]' attribute spelling is deprecated in C2x; use '[[noreturn]]' instead}}
+[[_Noreturn]] void func10(void); // all-warning {{the '[[_Noreturn]]' attribute spelling is deprecated in C23; use '[[noreturn]]' instead}}
// Test preprocessor functionality after including <stdnoreturn.h>.
#if !__has_c_attribute(noreturn)
@@ -62,4 +62,4 @@ void noreturn func9(void);
// Test that a macro which expands to _Noreturn is still diagnosed when it
// doesn't come from a system header.
#define NORETURN _Noreturn
-[[NORETURN]] void func11(void); // all-warning {{the '[[_Noreturn]]' attribute spelling is deprecated in C2x; use '[[noreturn]]' instead}}
+[[NORETURN]] void func11(void); // all-warning {{the '[[_Noreturn]]' attribute spelling is deprecated in C23; use '[[noreturn]]' instead}}
diff --git a/clang/test/Sema/c89.c b/clang/test/Sema/c89.c
index 0bbd14eca6b412..e89f4fd684c49a 100644
--- a/clang/test/Sema/c89.c
+++ b/clang/test/Sema/c89.c
@@ -44,7 +44,7 @@ test7;
void test8(int, x);
typedef int sometype;
-int a(sometype, y) {return 0;} /* expected-warning {{omitting the parameter name in a function definition is a C2x extension}}*/
+int a(sometype, y) {return 0;} /* expected-warning {{omitting the parameter name in a function definition is a C23 extension}}*/
void bar (void *);
void f11 (z) /* expected-error {{may not have 'void' type}} */
diff --git a/clang/test/Sema/complex-init-list.c b/clang/test/Sema/complex-init-list.c
index ac220d8e07c9bc..ce1cf2a1ff21cf 100644
--- a/clang/test/Sema/complex-init-list.c
+++ b/clang/test/Sema/complex-init-list.c
@@ -38,7 +38,7 @@ _Complex float valid5 = {1.0f, 1.0fi}; // expected-warning {{imaginary constants
struct teststruct invalid1 = { 1, 2 }; // expected-warning {{excess elements}}
_Complex float invalid2 = { 1, 2, 3 }; // expected-warning {{specifying real and imaginary components is an extension}} \
// expected-warning {{excess elements in scalar initializer}}
-_Complex float invalid3 = {}; // expected-warning {{use of an empty initializer is a C2x extension}}
+_Complex float invalid3 = {}; // expected-warning {{use of an empty initializer is a C23 extension}}
// Check incomplete array sizing
diff --git a/clang/test/Sema/compound-literal.c b/clang/test/Sema/compound-literal.c
index 46fa41e55c72cd..1b18df16506318 100644
--- a/clang/test/Sema/compound-literal.c
+++ b/clang/test/Sema/compound-literal.c
@@ -14,7 +14,7 @@ static int *p2 = (int []){2,x}; // expected-error {{initializer element is not a
static long *p3 = (long []){2,"x"}; // expected-error {{incompatible pointer to integer conversion initializing 'long' with an expression of type 'char[2]'}}
typedef struct { } cache_t; // expected-warning{{empty struct is a GNU extension}}
-static cache_t clo_I1_cache = ((cache_t) { } ); // expected-warning{{use of an empty initializer is a C2x extension}}
+static cache_t clo_I1_cache = ((cache_t) { } ); // expected-warning{{use of an empty initializer is a C23 extension}}
typedef struct Test {int a;int b;} Test;
static Test* ll = &(Test) {0,0};
diff --git a/clang/test/Sema/empty-init.c b/clang/test/Sema/empty-init.c
index 8cb4a77710c2b7..db02080e605409 100644
--- a/clang/test/Sema/empty-init.c
+++ b/clang/test/Sema/empty-init.c
@@ -17,13 +17,13 @@ struct S {
int a;
};
-struct S s = {}; /* c2x-warning {{use of an empty initializer is incompatible with C standards before C2x}}
- c2x-ext-warning {{use of an empty initializer is a C2x extension}}
+struct S s = {}; /* c2x-warning {{use of an empty initializer is incompatible with C standards before C23}}
+ c2x-ext-warning {{use of an empty initializer is a C23 extension}}
*/
void func(void) {
- struct S s2 = {}; /* c2x-warning {{use of an empty initializer is incompatible with C standards before C2x}}
- c2x-ext-warning {{use of an empty initializer is a C2x extension}}
+ struct S s2 = {}; /* c2x-warning {{use of an empty initializer is incompatible with C standards before C23}}
+ c2x-ext-warning {{use of an empty initializer is a C23 extension}}
*/
(void)s2;
}
diff --git a/clang/test/Sema/flexible-array-init.c b/clang/test/Sema/flexible-array-init.c
index 57c7344dd33e1c..5ae85e5a622c5f 100644
--- a/clang/test/Sema/flexible-array-init.c
+++ b/clang/test/Sema/flexible-array-init.c
@@ -10,7 +10,7 @@ void test(void) {
struct one x3 = {5, {1, 2, 3}}; // expected-error{{initialization of flexible array member is not allowed}}
struct one x3a = { 5 };
struct one x3b = { .a = 5 };
- struct one x3c = { 5, {} }; // expected-warning{{use of an empty initializer is a C2x extension}} \
+ struct one x3c = { 5, {} }; // expected-warning{{use of an empty initializer is a C23 extension}} \
// expected-warning{{flexible array initialization is a GNU extension}} \
// expected-warning{{zero size arrays are an extension}}
}
@@ -24,13 +24,13 @@ struct bar { struct foo z; }; // expected-warning {{'z' may not be nested in a s
struct foo a = { 1, { 2, 3, 4 } }; // expected-warning{{flexible array initialization is a GNU extension}}
struct bar b = { { 1, { 2, 3, 4 } } }; // expected-error{{initialization of flexible array member is not allowed}}
struct bar c = { { 1, { } } }; // // expected-warning{{flexible array initialization is a GNU extension}} \
- // expected-warning{{use of an empty initializer is a C2x extension}} \
+ // expected-warning{{use of an empty initializer is a C23 extension}} \
// expected-warning{{zero size arrays are an extension}}
struct foo d[1] = { { 1, { 2, 3, 4 } } }; // expected-warning{{'struct foo' may not be used as an array element due to flexible array member}} \
// expected-error{{initialization of flexible array member is not allowed}}
struct foo desig_foo = { .y = {2, 3, 4} }; // expected-warning{{flexible array initialization is a GNU extension}}
-struct bar desig_bar = { .z.y = { } }; // expected-warning{{use of an empty initializer is a C2x extension}} \
+struct bar desig_bar = { .z.y = { } }; // expected-warning{{use of an empty initializer is a C23 extension}} \
// expected-warning{{zero size arrays are an extension}} \
// expected-warning{{flexible array initialization is a GNU extension}}
struct bar desig_bar2 = { .z.y = { 2, 3, 4} }; // expected-error{{initialization of flexible array member is not allowed}}
diff --git a/clang/test/Sema/function.c b/clang/test/Sema/function.c
index 1143fe8f50d538..bdaa1e4d0b892c 100644
--- a/clang/test/Sema/function.c
+++ b/clang/test/Sema/function.c
@@ -30,7 +30,7 @@ void t10(){}
void t11(){t10(1);} // expected-warning{{too many arguments}}
// PR3208
-void t12(int) {} // c2x-warning{{omitting the parameter name in a function definition is a C2x extension}}
+void t12(int) {} // c2x-warning{{omitting the parameter name in a function definition is a C23 extension}}
// PR2790
void t13() {
@@ -81,7 +81,7 @@ fn_t t17;
// PR4049
unknown_type t18(void*) { // expected-error {{unknown type name 'unknown_type'}} \
- // c2x-warning {{omitting the parameter name in a function definition is a C2x extension}}
+ // c2x-warning {{omitting the parameter name in a function definition is a C23 extension}}
}
unknown_type t19(int* P) { // expected-error {{unknown type name 'unknown_type'}}
diff --git a/clang/test/Sema/knr-def-call.c b/clang/test/Sema/knr-def-call.c
index 172cb07c93c637..6f13ac4b1d6cde 100644
--- a/clang/test/Sema/knr-def-call.c
+++ b/clang/test/Sema/knr-def-call.c
@@ -1,19 +1,19 @@
// RUN: %clang_cc1 -triple i386-pc-unknown -Wconversion -Wliteral-conversion -fsyntax-only -verify %s
// C DR #316, PR 3626.
-void f0(a, b, c, d) int a,b,c,d; {} // expected-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C2x}}
+void f0(a, b, c, d) int a,b,c,d; {} // expected-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C23}}
void t0(void) {
f0(1); // expected-warning{{too few arguments}}
}
-void f1(a, b) int a, b; {} // expected-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C2x}}
+void f1(a, b) int a, b; {} // expected-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C23}}
void t1(void) {
f1(1, 2, 3); // expected-warning{{too many arguments}}
}
void f2(float); // expected-note{{previous declaration is here}}
void f2(x) float x; { } // expected-warning{{promoted type 'double' of K&R function parameter is not compatible with the parameter type 'float' declared in a previous prototype}} \
- expected-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C2x}}
+ expected-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C23}}
typedef void (*f3)(void);
f3 t3(int b) { return b? f0 : f1; } // okay
@@ -33,7 +33,7 @@ char *rindex(s, c)
// PR8314
void proto(int);
-void proto(x) // expected-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C2x}}
+void proto(x) // expected-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C23}}
int x;
{
}
@@ -45,6 +45,6 @@ void use_proto() {
// PR31020
void func(short d) __attribute__((cdecl)); // expected-note{{previous declaration is here}}
-void __attribute__((cdecl)) func(d) // expected-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C2x}}
+void __attribute__((cdecl)) func(d) // expected-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C23}}
short d; // expected-warning{{promoted type 'int' of K&R function parameter is not compatible with the parameter type 'short' declared in a previous prototype}}
{}
diff --git a/clang/test/Sema/knr-variadic-def.c b/clang/test/Sema/knr-variadic-def.c
index 18ca866e03bdec..d5b49f51a5697d 100644
--- a/clang/test/Sema/knr-variadic-def.c
+++ b/clang/test/Sema/knr-variadic-def.c
@@ -5,7 +5,7 @@
char *foo = "test";
int test(char*,...);
-int test(fmt) // expected-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C2x}}
+int test(fmt) // expected-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C23}}
char*fmt;
{
va_list ap;
@@ -21,7 +21,7 @@ int test(fmt) // expected-warning {{a function definition without a prototype is
void exit(); // expected-warning {{a function declaration without a prototype is deprecated in all versions of C}}
-int main(argc,argv) // expected-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C2x}}
+int main(argc,argv) // expected-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C23}}
int argc;char**argv;
{
exit(test("",foo));
diff --git a/clang/test/Sema/matrix-type-builtins.c b/clang/test/Sema/matrix-type-builtins.c
index 43f39f26568e14..b5548831002e35 100644
--- a/clang/test/Sema/matrix-type-builtins.c
+++ b/clang/test/Sema/matrix-type-builtins.c
@@ -8,17 +8,17 @@ typedef unsigned ix3x3 __attribute__((matrix_type(3, 3)));
// Verify that we can use the [[]] spelling of the attribute.
// We intentionally use the same type alias name to check that both versions
// define the same type.
-typedef float [[clang::matrix_type(5, 10)]] sx5x10_t; // expected-warning {{[[]] attributes are a C2x extension}}
-typedef int [[clang::matrix_type(3, 2)]] ix3x2_t; // expected-warning {{[[]] attributes are a C2x extension}}
-[[clang::matrix_type(5, 10)]] typedef float sx5x10_t; // expected-warning {{[[]] attributes are a C2x extension}}
+typedef float [[clang::matrix_type(5, 10)]] sx5x10_t; // expected-warning {{[[]] attributes are a C23 extension}}
+typedef int [[clang::matrix_type(3, 2)]] ix3x2_t; // expected-warning {{[[]] attributes are a C23 extension}}
+[[clang::matrix_type(5, 10)]] typedef float sx5x10_t; // expected-warning {{[[]] attributes are a C23 extension}}
// expected-warning at -1 {{applying attribute 'matrix_type' to a declaration is deprecated; apply it to the type instead}}
-[[clang::matrix_type(3, 2)]] typedef int ix3x2_t; // expected-warning {{[[]] attributes are a C2x extension}}
+[[clang::matrix_type(3, 2)]] typedef int ix3x2_t; // expected-warning {{[[]] attributes are a C23 extension}}
// expected-warning at -1 {{applying attribute 'matrix_type' to a declaration is deprecated; apply it to the type instead}}
// Attribute may not be used outside typedefs.
-[[clang::matrix_type(3, 2)]] int ix3x2_var; // expected-warning {{[[]] attributes are a C2x extension}}
+[[clang::matrix_type(3, 2)]] int ix3x2_var; // expected-warning {{[[]] attributes are a C23 extension}}
// expected-error at -1 {{'matrix_type' attribute only applies to typedefs}}
-int [[clang::matrix_type(3, 2)]] ix3x2_var; // expected-warning {{[[]] attributes are a C2x extension}}
+int [[clang::matrix_type(3, 2)]] ix3x2_var; // expected-warning {{[[]] attributes are a C23 extension}}
// expected-error at -1 {{'matrix_type' attribute only applies to typedefs}}
void transpose(sx5x10_t a, ix3x2_t b, dx3x3 c, int *d, int e) {
diff --git a/clang/test/Sema/nullptr-prec2x.c b/clang/test/Sema/nullptr-prec2x.c
index 387746f20a3eaa..39479d4343a569 100644
--- a/clang/test/Sema/nullptr-prec2x.c
+++ b/clang/test/Sema/nullptr-prec2x.c
@@ -2,7 +2,7 @@
#include <stddef.h>
-int nullptr; // expected-warning {{'nullptr' is a keyword in C2x}}
+int nullptr; // expected-warning {{'nullptr' is a keyword in C23}}
nullptr_t val; // expected-error {{unknown type name 'nullptr_t'}}
diff --git a/clang/test/Sema/pre-c2x-compat.c b/clang/test/Sema/pre-c2x-compat.c
index cf40efb62cfa74..fad472f1f72d54 100644
--- a/clang/test/Sema/pre-c2x-compat.c
+++ b/clang/test/Sema/pre-c2x-compat.c
@@ -1,3 +1,3 @@
// RUN: %clang_cc1 %s -std=c2x -Wpre-c2x-compat -pedantic -fsyntax-only -verify
-int digit_seps = 123'456; // expected-warning {{digit separators are incompatible with C standards before C2x}}
+int digit_seps = 123'456; // expected-warning {{digit separators are incompatible with C standards before C23}}
diff --git a/clang/test/Sema/vector-gcc-compat.c b/clang/test/Sema/vector-gcc-compat.c
index a3107945c1f5b3..7764b3bf686add 100644
--- a/clang/test/Sema/vector-gcc-compat.c
+++ b/clang/test/Sema/vector-gcc-compat.c
@@ -20,14 +20,14 @@ typedef int v4i32 __attribute((vector_size(16)));
// Verify that we can use the [[]] spelling of the attribute.
// We intentionally use the same type alias name to check that both versions
// define the same type.
-typedef long long v2i64 [[gnu::vector_size(16)]]; // expected-warning{{[[]] attributes are a C2x extension}}
-typedef int v2i32 [[gnu::vector_size(8)]]; // expected-warning{{[[]] attributes are a C2x extension}}
+typedef long long v2i64 [[gnu::vector_size(16)]]; // expected-warning{{[[]] attributes are a C23 extension}}
+typedef int v2i32 [[gnu::vector_size(8)]]; // expected-warning{{[[]] attributes are a C23 extension}}
// Check various positions where the [[]] spelling can or cannot be used.
-[[gnu::vector_size(16)]] typedef long long v2i64; // expected-warning{{[[]] attributes are a C2x extension}}
+[[gnu::vector_size(16)]] typedef long long v2i64; // expected-warning{{[[]] attributes are a C23 extension}}
typedef long long [[gnu::vector_size(16)]] v2i64_ignored;
// expected-warning at -1{{'vector_size' attribute ignored}}
- // expected-warning at -2{{[[]] attributes are a C2x extension}}
+ // expected-warning at -2{{[[]] attributes are a C23 extension}}
// FIXME: Contrary to the error message that we emit, GCC does actually allow
// the attribute in the following position. Somewhat surprisingly, the attribute
// is applied not to the pointer but to the base type, i.e. this declaration has
@@ -35,10 +35,10 @@ typedef long long [[gnu::vector_size(16)]] v2i64_ignored;
typedef long long *[[gnu::vector_size(16)]] v2i64_doesnt_work;
// expected-error at -1{{invalid vector element type 'long long *'}}
// expected-warning at -2{{GCC does not allow the 'vector_size' attribute to be written on a type}}
- // expected-warning at -3{{[[]] attributes are a C2x extension}}
+ // expected-warning at -3{{[[]] attributes are a C23 extension}}
// Verify that we can use the attribute outside of a typedef.
-static int v2i32_var [[gnu::vector_size(8)]]; // expected-warning{{[[]] attributes are a C2x extension}}
+static int v2i32_var [[gnu::vector_size(8)]]; // expected-warning{{[[]] attributes are a C23 extension}}
void arithmeticTest(void);
void logicTest(void);
diff --git a/clang/test/Sema/vla.c b/clang/test/Sema/vla.c
index efdc11b85be99c..54afe7c681bd0f 100644
--- a/clang/test/Sema/vla.c
+++ b/clang/test/Sema/vla.c
@@ -113,14 +113,14 @@ void test_fold_to_constant_array(void) {
jump_over_a2:;
goto jump_over_a3;
- char a3[ksize] = {}; // expected-warning {{variable length array folded to constant array as an extension}} expected-warning{{use of an empty initializer is a C2x extension}}
+ char a3[ksize] = {}; // expected-warning {{variable length array folded to constant array as an extension}} expected-warning{{use of an empty initializer is a C23 extension}}
jump_over_a3:;
goto jump_over_a4; // expected-error{{cannot jump from this goto statement to its label}}
char a4[ksize][2]; // expected-note{{variable length array}}
jump_over_a4:;
- char a5[ksize][2] = {}; // expected-warning {{variable length array folded to constant array as an extension}} expected-warning{{use of an empty initializer is a C2x extension}}
+ char a5[ksize][2] = {}; // expected-warning {{variable length array folded to constant array as an extension}} expected-warning{{use of an empty initializer is a C23 extension}}
int a6[ksize] = {1,2,3,4}; // expected-warning{{variable length array folded to constant array as an extension}}
diff --git a/clang/test/Sema/warn-deprecated-non-prototype.c b/clang/test/Sema/warn-deprecated-non-prototype.c
index 47994934baed67..40722813b2580b 100644
--- a/clang/test/Sema/warn-deprecated-non-prototype.c
+++ b/clang/test/Sema/warn-deprecated-non-prototype.c
@@ -23,37 +23,37 @@ void whatever(void) {
void again() {} // strict-warning {{a function declaration without a prototype is deprecated in all versions of C}}
// On by default warnings
-void func(); // both-warning {{a function declaration without a prototype is deprecated in all versions of C and is treated as a zero-parameter prototype in C2x, conflicting with a subsequent definition}} \
+void func(); // both-warning {{a function declaration without a prototype is deprecated in all versions of C and is treated as a zero-parameter prototype in C23, conflicting with a subsequent definition}} \
strict-warning {{a function declaration without a prototype is deprecated in all versions of C}}
-void func(a, b) int a, b; {} // both-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C2x}}
+void func(a, b) int a, b; {} // both-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C23}}
-void one_more(a, b) int a, b; {} // both-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C2x}}
+void one_more(a, b) int a, b; {} // both-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C23}}
void sheesh(int a);
-void sheesh(a) int a; {} // both-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C2x}}
+void sheesh(a) int a; {} // both-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C23}}
void another(); // strict-warning {{a function declaration without a prototype is deprecated in all versions of C}}
int main(void) {
- another(1, 2); // both-warning {{passing arguments to 'another' without a prototype is deprecated in all versions of C and is not supported in C2x}}
+ another(1, 2); // both-warning {{passing arguments to 'another' without a prototype is deprecated in all versions of C and is not supported in C23}}
}
-void order1(); // both-warning {{a function declaration without a prototype is deprecated in all versions of C and is treated as a zero-parameter prototype in C2x, conflicting with a subsequent declaration}} \
+void order1(); // both-warning {{a function declaration without a prototype is deprecated in all versions of C and is treated as a zero-parameter prototype in C23, conflicting with a subsequent declaration}} \
strict-warning {{a function declaration without a prototype is deprecated in all versions of C}}
void order1(int i); // both-note {{conflicting prototype is here}}
void order2(int i); // both-note {{conflicting prototype is here}}
-void order2(); // both-warning {{a function declaration without a prototype is deprecated in all versions of C and is treated as a zero-parameter prototype in C2x, conflicting with a previous declaration}} \
+void order2(); // both-warning {{a function declaration without a prototype is deprecated in all versions of C and is treated as a zero-parameter prototype in C23, conflicting with a previous declaration}} \
strict-warning {{a function declaration without a prototype is deprecated in all versions of C}}
-void order3(); // both-warning {{a function declaration without a prototype is deprecated in all versions of C and is treated as a zero-parameter prototype in C2x, conflicting with a subsequent definition}} \
+void order3(); // both-warning {{a function declaration without a prototype is deprecated in all versions of C and is treated as a zero-parameter prototype in C23, conflicting with a subsequent definition}} \
strict-warning {{a function declaration without a prototype is deprecated in all versions of C}}
void order3(int i) {} // both-note {{conflicting prototype is here}}
// Just because the prototype is variadic doesn't mean we shouldn't warn on the
-// K&R C function definition; this still changes behavior in C2x.
+// K&R C function definition; this still changes behavior in C23.
void test(char*,...);
-void test(fmt) // both-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C2x}}
+void test(fmt) // both-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C23}}
char*fmt;
{
}
@@ -80,7 +80,7 @@ void calls(void) {
// Ensure that we diagnose calls to functions without a prototype, but only
// if they pass arguments.
never_defined(); // OK
- never_defined(1); // both-warning {{passing arguments to 'never_defined' without a prototype is deprecated in all versions of C and is not supported in C2x}}
+ never_defined(1); // both-warning {{passing arguments to 'never_defined' without a prototype is deprecated in all versions of C and is not supported in C23}}
// Ensure that calls to builtins without a traditional prototype are not
// diagnosed.
@@ -93,7 +93,7 @@ void calls(void) {
// Ensure that a call through a function pointer is still diagnosed properly.
fp f;
f(); // OK
- f(1, 2); // both-warning {{passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x}}
+ f(1, 2); // both-warning {{passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C23}}
// Ensure that we don't diagnose when the diagnostic group is disabled.
depr_non_prot(1); // OK
@@ -110,7 +110,7 @@ void calls(void) {
// prototype twice when the function was declared static in the following
// example.
static int GH58181(int x, int y);
-static int GH58181(x, y) // both-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C2x}}
+static int GH58181(x, y) // both-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C23}}
int x;
int y;
{
diff --git a/clang/test/Sema/warn-strict-prototypes.c b/clang/test/Sema/warn-strict-prototypes.c
index 21e6f8ed7868a7..66bc80f5602764 100644
--- a/clang/test/Sema/warn-strict-prototypes.c
+++ b/clang/test/Sema/warn-strict-prototypes.c
@@ -48,7 +48,7 @@ void bar3(void) {
}
// K&R function definition not preceded by full prototype
-int foo9(a, b) // expected-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C2x}}
+int foo9(a, b) // expected-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C23}}
int a, b;
{
return a + b;
@@ -56,17 +56,17 @@ int foo9(a, b) // expected-warning {{a function definition without a prototype i
// Function declaration with no types
void foo10(); // expected-warning {{a function declaration without a prototype is deprecated in all versions of C}} \
- expected-warning {{a function declaration without a prototype is deprecated in all versions of C and is treated as a zero-parameter prototype in C2x, conflicting with a subsequent definition}}
+ expected-warning {{a function declaration without a prototype is deprecated in all versions of C and is treated as a zero-parameter prototype in C23, conflicting with a subsequent definition}}
// CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:12-[[@LINE-2]]:12}:"void"
// K&R function definition with incomplete param list declared
-void foo10(p, p2) void *p; {} // expected-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C2x}} \
+void foo10(p, p2) void *p; {} // expected-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C23}} \
expected-warning {{parameter 'p2' was not declared, defaults to 'int'; ISO C99 and later do not support implicit int}}
void foo11(int p, int p2);
-void foo11(p, p2) int p; int p2; {} // expected-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C2x}}
+void foo11(p, p2) int p; int p2; {} // expected-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C23}}
// PR31020
-void __attribute__((cdecl)) foo12(d) // expected-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C2x}}
+void __attribute__((cdecl)) foo12(d) // expected-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C23}}
short d;
{}
diff --git a/clang/test/SemaObjC/nonnull.m b/clang/test/SemaObjC/nonnull.m
index 218aad85e673b6..18a0511f06641b 100644
--- a/clang/test/SemaObjC/nonnull.m
+++ b/clang/test/SemaObjC/nonnull.m
@@ -22,7 +22,7 @@ extern void func3 (void (^block1)(), int, void (^block2)(), int)
extern void func4 (void (^block1)(), void (^block2)()) __attribute__((nonnull(1)))
__attribute__((nonnull(2)));
-void func6(); // expected-warning {{a function declaration without a prototype is deprecated in all versions of C and is treated as a zero-parameter prototype in C2x, conflicting with a subsequent definition}}
+void func6(); // expected-warning {{a function declaration without a prototype is deprecated in all versions of C and is treated as a zero-parameter prototype in C23, conflicting with a subsequent definition}}
void func7();
void
@@ -41,8 +41,8 @@ extern void func4 (void (^block1)(), void (^block2)()) __attribute__((nonnull(1)
func4(0, cp1); // expected-warning {{null passed to a callee that requires a non-null argument}}
func4(cp1, 0); // expected-warning {{null passed to a callee that requires a non-null argument}}
- func6((NSObject*) 0); // expected-warning {{passing arguments to 'func6' without a prototype is deprecated in all versions of C and is not supported in C2x}}
- func7((NSObject*) 0); // expected-warning {{passing arguments to 'func7' without a prototype is deprecated in all versions of C and is not supported in C2x}}
+ func6((NSObject*) 0); // expected-warning {{passing arguments to 'func6' without a prototype is deprecated in all versions of C and is not supported in C23}}
+ func7((NSObject*) 0); // expected-warning {{passing arguments to 'func7' without a prototype is deprecated in all versions of C and is not supported in C23}}
}
void func5(int) NONNULL_ATTR; // no warning
More information about the cfe-commits
mailing list