def warn_cxx17_compat_spaceship : Warning<
"'<=>' operator is incompatible with C++ standards before C++20">,
InGroup<CXXPre20Compat>, DefaultIgnore;
-def warn_cxx2a_compat_spaceship : Warning<
+def warn_cxx20_compat_spaceship : Warning<
"'<=>' is a single token in C++20; "
"add a space to avoid a change in behavior">,
InGroup<CXX20Compat>;
def warn_cxx11_keyword : Warning<"'%0' is a keyword in C++11">,
InGroup<CXX11Compat>, DefaultIgnore;
-def warn_cxx2a_keyword : Warning<"'%0' is a keyword in C++20">,
+def warn_cxx20_keyword : Warning<"'%0' is a keyword in C++20">,
InGroup<CXX20Compat>, DefaultIgnore;
def ext_unterminated_char_or_string : ExtWarn<
def err_ms_property_initializer : Error<
"property declaration cannot have an in-class initializer">;
-def warn_cxx2a_compat_explicit_bool : Warning<
+def warn_cxx20_compat_explicit_bool : Warning<
"this expression will be parsed as explicit(bool) in C++20">,
InGroup<CXX20Compat>, DefaultIgnore;
def warn_cxx17_compat_explicit_bool : Warning<
def err_init_list_bad_dest_type : Error<
"%select{|non-aggregate }0type %1 cannot be initialized with an initializer "
"list">;
-def warn_cxx2a_compat_aggregate_init_with_ctors : Warning<
+def warn_cxx20_compat_aggregate_init_with_ctors : Warning<
"aggregate initialization of type %0 with user-declared constructors "
"is incompatible with C++20">, DefaultIgnore, InGroup<CXX20Compat>;
"use of this statement in a constexpr %select{function|constructor}0 "
"is incompatible with C++ standards before C++14">,
InGroup<CXXPre14Compat>, DefaultIgnore;
-def ext_constexpr_body_invalid_stmt_cxx2a : ExtWarn<
+def ext_constexpr_body_invalid_stmt_cxx20 : ExtWarn<
"use of this statement in a constexpr %select{function|constructor}0 "
"is a C++20 extension">, InGroup<CXX20>;
def warn_cxx17_compat_constexpr_body_invalid_stmt : Warning<
"previous return statement is here">;
// C++20 function try blocks in constexpr
-def ext_constexpr_function_try_block_cxx2a : ExtWarn<
+def ext_constexpr_function_try_block_cxx20 : ExtWarn<
"function try block in constexpr %select{function|constructor}0 is "
"a C++20 extension">, InGroup<CXX20>;
def warn_cxx17_compat_constexpr_function_try_block : Warning<
def err_array_init_utf8_string_into_char : Error<
"%select{|ISO C++20 does not permit }0initialization of char array with "
"UTF-8 string literal%select{ is not permitted by '-fchar8_t'|}0">;
-def warn_cxx2a_compat_utf8_string : Warning<
+def warn_cxx20_compat_utf8_string : Warning<
"type of UTF-8 string literal will change from array of const char to "
"array of const char8_t in C++20">, InGroup<CXX20Compat>, DefaultIgnore;
-def note_cxx2a_compat_utf8_string_remove_u8 : Note<
+def note_cxx20_compat_utf8_string_remove_u8 : Note<
"remove 'u8' prefix to avoid a change of behavior; "
"Clang encodes unprefixed narrow string literals as UTF-8">;
def err_array_init_different_type : Error<
"%plural{2:with|4:from|:and}0 "
"%select{enumeration|floating-point}1 type %3">,
InGroup<EnumFloatConversion>, DefaultIgnore;
-def warn_arith_conv_enum_float_cxx2a : Warning<
+def warn_arith_conv_enum_float_cxx20 : Warning<
"%sub{select_arith_conv_kind}0 "
"%select{floating-point|enumeration}1 type %2 "
"%plural{2:with|4:from|:and}0 "
"%sub{select_arith_conv_kind}0 "
"different enumeration types%diff{ ($ and $)|}1,2">,
InGroup<EnumEnumConversion>, DefaultIgnore;
-def warn_arith_conv_mixed_enum_types_cxx2a : Warning<
+def warn_arith_conv_mixed_enum_types_cxx20 : Warning<
"%sub{select_arith_conv_kind}0 "
"different enumeration types%diff{ ($ and $)|}1,2 is deprecated">,
InGroup<DeprecatedEnumEnumConversion>;
def warn_arith_conv_mixed_anon_enum_types : Warning<
warn_arith_conv_mixed_enum_types.Text>,
InGroup<AnonEnumEnumConversion>, DefaultIgnore;
-def warn_arith_conv_mixed_anon_enum_types_cxx2a : Warning<
- warn_arith_conv_mixed_enum_types_cxx2a.Text>,
+def warn_arith_conv_mixed_anon_enum_types_cxx20 : Warning<
+ warn_arith_conv_mixed_enum_types_cxx20.Text>,
InGroup<DeprecatedAnonEnumEnumConversion>;
def warn_conditional_mixed_enum_types : Warning<
warn_arith_conv_mixed_enum_types.Text>,
InGroup<EnumCompareConditional>, DefaultIgnore;
-def warn_conditional_mixed_enum_types_cxx2a : Warning<
- warn_arith_conv_mixed_enum_types_cxx2a.Text>,
+def warn_conditional_mixed_enum_types_cxx20 : Warning<
+ warn_arith_conv_mixed_enum_types_cxx20.Text>,
InGroup<DeprecatedEnumCompareConditional>;
def warn_comparison_mixed_enum_types : Warning<
warn_arith_conv_mixed_enum_types.Text>,
InGroup<EnumCompare>;
-def warn_comparison_mixed_enum_types_cxx2a : Warning<
- warn_arith_conv_mixed_enum_types_cxx2a.Text>,
+def warn_comparison_mixed_enum_types_cxx20 : Warning<
+ warn_arith_conv_mixed_enum_types_cxx20.Text>,
InGroup<DeprecatedEnumCompare>;
def warn_comparison_of_mixed_enum_types_switch : Warning<
"comparison of different enumeration types in switch statement"
def warn_cxx17_compat_equals_this_lambda_capture : Warning<
"explicit capture of 'this' with a capture default of '=' is incompatible "
"with C++ standards before C++20">, InGroup<CXXPre20Compat>, DefaultIgnore;
- def ext_equals_this_lambda_capture_cxx2a : ExtWarn<
+ def ext_equals_this_lambda_capture_cxx20 : ExtWarn<
"explicit capture of 'this' with a capture default of '=' "
"is a C++20 extension">, InGroup<CXX20>;
def warn_deprecated_this_capture : Warning<
"use of the %0 attribute is a C++14 extension">, InGroup<CXX14>;
def ext_cxx17_attr : Extension<
"use of the %0 attribute is a C++17 extension">, InGroup<CXX17>;
-def ext_cxx2a_attr : Extension<
+def ext_cxx20_attr : Extension<
"use of the %0 attribute is a C++20 extension">, InGroup<CXX20>;
def warn_unused_comparison : Warning<
// Suggest adding a space between the '<=' and the '>' to avoid a
// change in semantics if this turns up in C++ <=17 mode.
if (getLangOpts().CPlusPlus && !isLexingRawMode()) {
- Diag(BufferPtr, diag::warn_cxx2a_compat_spaceship)
+ Diag(BufferPtr, diag::warn_cxx20_compat_spaceship)
<< FixItHint::CreateInsertion(
getSourceLocation(CurPtr + SizeTmp, SizeTmp2), " ");
}
#define CXX11_KEYWORD(NAME, FLAGS) \
.Case(#NAME, diag::warn_cxx11_keyword)
#define CXX20_KEYWORD(NAME, FLAGS) \
- .Case(#NAME, diag::warn_cxx2a_keyword)
+ .Case(#NAME, diag::warn_cxx20_keyword)
#include "clang/Basic/TokenKinds.def"
;
} else
Tracker.skipToEnd();
} else {
- Diag(Tok.getLocation(), diag::warn_cxx2a_compat_explicit_bool);
+ Diag(Tok.getLocation(), diag::warn_cxx20_compat_explicit_bool);
}
}
isInvalid = DS.setFunctionSpecExplicit(ExplicitLoc, PrevSpec, DiagID,
const LangOptions &LO = S.getLangOpts();
if (AL.getNumArgs() == 1) {
if (LO.CPlusPlus && !LO.CPlusPlus20)
- S.Diag(AL.getLoc(), diag::ext_cxx2a_attr) << AL;
+ S.Diag(AL.getLoc(), diag::ext_cxx20_attr) << AL;
// Since this this is spelled [[nodiscard]], get the optional string
// literal. If in C++ mode, but not in C++2a mode, diagnose as an
case Sema::CheckConstexprKind::Diagnose:
SemaRef.Diag(Body->getBeginLoc(),
!SemaRef.getLangOpts().CPlusPlus20
- ? diag::ext_constexpr_function_try_block_cxx2a
+ ? diag::ext_constexpr_function_try_block_cxx20
: diag::warn_cxx17_compat_constexpr_function_try_block)
<< isa<CXXConstructorDecl>(Dcl);
break;
SemaRef.Diag(Cxx2aLoc,
SemaRef.getLangOpts().CPlusPlus20
? diag::warn_cxx17_compat_constexpr_body_invalid_stmt
- : diag::ext_constexpr_body_invalid_stmt_cxx2a)
+ : diag::ext_constexpr_body_invalid_stmt_cxx20)
<< isa<CXXConstructorDecl>(Dcl);
} else if (Cxx1yLoc.isValid()) {
SemaRef.Diag(Cxx1yLoc,
if ((!IsCompAssign && LEnum && R->isFloatingType()) ||
(REnum && L->isFloatingType())) {
S.Diag(Loc, S.getLangOpts().CPlusPlus20
- ? diag::warn_arith_conv_enum_float_cxx2a
+ ? diag::warn_arith_conv_enum_float_cxx20
: diag::warn_arith_conv_enum_float)
<< LHS->getSourceRange() << RHS->getSourceRange()
<< (int)ACK << LEnum << L << R;
// user cares about this, but this situation is still deprecated in
// C++2a. Use a different warning group.
DiagID = S.getLangOpts().CPlusPlus20
- ? diag::warn_arith_conv_mixed_anon_enum_types_cxx2a
+ ? diag::warn_arith_conv_mixed_anon_enum_types_cxx20
: diag::warn_arith_conv_mixed_anon_enum_types;
} else if (ACK == Sema::ACK_Conditional) {
// Conditional expressions are separated out because they have
// historically had a different warning flag.
DiagID = S.getLangOpts().CPlusPlus20
- ? diag::warn_conditional_mixed_enum_types_cxx2a
+ ? diag::warn_conditional_mixed_enum_types_cxx20
: diag::warn_conditional_mixed_enum_types;
} else if (ACK == Sema::ACK_Comparison) {
// Comparison expressions are separated out because they have
// historically had a different warning flag.
DiagID = S.getLangOpts().CPlusPlus20
- ? diag::warn_comparison_mixed_enum_types_cxx2a
+ ? diag::warn_comparison_mixed_enum_types_cxx20
: diag::warn_comparison_mixed_enum_types;
} else {
DiagID = S.getLangOpts().CPlusPlus20
- ? diag::warn_arith_conv_mixed_enum_types_cxx2a
+ ? diag::warn_arith_conv_mixed_enum_types_cxx20
: diag::warn_arith_conv_mixed_enum_types;
}
S.Diag(Loc, DiagID) << LHS->getSourceRange() << RHS->getSourceRange()
// becomes ill-formed in C++2a.
if (getLangOpts().CPlusPlus && !getLangOpts().CPlusPlus20 &&
!getLangOpts().Char8 && Kind == StringLiteral::UTF8) {
- Diag(StringTokLocs.front(), diag::warn_cxx2a_compat_utf8_string);
+ Diag(StringTokLocs.front(), diag::warn_cxx20_compat_utf8_string);
// Create removals for all 'u8' prefixes in the string literal(s). This
// ensures C++2a compatibility (but may change the program behavior when
// built by non-Clang compilers for which the execution character set is
// not always UTF-8).
- auto RemovalDiag = PDiag(diag::note_cxx2a_compat_utf8_string_remove_u8);
+ auto RemovalDiag = PDiag(diag::note_cxx20_compat_utf8_string_remove_u8);
SourceLocation RemovalDiagLoc;
for (const Token &Tok : StringToks) {
if (Tok.getKind() == tok::utf8_string_literal) {
auto *CXXRD = T->getAsCXXRecordDecl();
if (!VerifyOnly && CXXRD && CXXRD->hasUserDeclaredConstructor()) {
SemaRef.Diag(StructuredSubobjectInitList->getBeginLoc(),
- diag::warn_cxx2a_compat_aggregate_init_with_ctors)
+ diag::warn_cxx20_compat_aggregate_init_with_ctors)
<< StructuredSubobjectInitList->getSourceRange() << T;
}
}
if (!HasEquivCtor) {
SemaRef.Diag(IList->getBeginLoc(),
- diag::warn_cxx2a_compat_aggregate_init_with_ctors)
+ diag::warn_cxx20_compat_aggregate_init_with_ctors)
<< IList->getSourceRange() << T;
}
}
// redundant but accepted for compatibility with ISO C++14. --end note ]
if (Intro.Default == LCD_ByCopy && C->Kind != LCK_StarThis)
Diag(C->Loc, !getLangOpts().CPlusPlus20
- ? diag::ext_equals_this_lambda_capture_cxx2a
+ ? diag::ext_equals_this_lambda_capture_cxx20
: diag::warn_cxx17_compat_equals_this_lambda_capture);
// C++11 [expr.prim.lambda]p12: