forked from OSchip/llvm-project
Rename warning identifiers from cxx2a to cxx20; NFC.
This commit is contained in:
parent
2d0c9bf55e
commit
1b3f1f4436
|
@ -33,7 +33,7 @@ def warn_cxx98_compat_less_colon_colon : Warning<
|
|||
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>;
|
||||
|
@ -78,7 +78,7 @@ def ext_token_used : Extension<"extension used">,
|
|||
|
||||
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<
|
||||
|
|
|
@ -676,7 +676,7 @@ def err_ms_property_expected_comma_or_rparen : Error<
|
|||
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<
|
||||
|
|
|
@ -2009,7 +2009,7 @@ def err_reference_bind_init_list : Error<
|
|||
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>;
|
||||
|
||||
|
@ -2530,7 +2530,7 @@ def warn_cxx11_compat_constexpr_body_invalid_stmt : Warning<
|
|||
"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<
|
||||
|
@ -2593,7 +2593,7 @@ def note_constexpr_body_previous_return : Note<
|
|||
"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<
|
||||
|
@ -6294,10 +6294,10 @@ def note_array_init_plain_string_into_char8_t : Note<
|
|||
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<
|
||||
|
@ -6438,7 +6438,7 @@ def warn_arith_conv_enum_float : Warning<
|
|||
"%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 "
|
||||
|
@ -6448,27 +6448,27 @@ def warn_arith_conv_mixed_enum_types : Warning<
|
|||
"%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"
|
||||
|
@ -7253,7 +7253,7 @@ let CategoryName = "Lambda Issue" in {
|
|||
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<
|
||||
|
@ -8129,7 +8129,7 @@ def ext_cxx14_attr : Extension<
|
|||
"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<
|
||||
|
|
|
@ -3711,7 +3711,7 @@ LexNextToken:
|
|||
// 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), " ");
|
||||
}
|
||||
|
|
|
@ -772,7 +772,7 @@ static diag::kind getFutureCompatDiagKind(const IdentifierInfo &II,
|
|||
#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"
|
||||
;
|
||||
|
||||
|
|
|
@ -3730,7 +3730,7 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS,
|
|||
} 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,
|
||||
|
|
|
@ -2840,7 +2840,7 @@ static void handleWarnUnusedResult(Sema &S, Decl *D, const ParsedAttr &AL) {
|
|||
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
|
||||
|
|
|
@ -2139,7 +2139,7 @@ static bool CheckConstexprFunctionBody(Sema &SemaRef, const FunctionDecl *Dcl,
|
|||
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;
|
||||
|
@ -2169,7 +2169,7 @@ static bool CheckConstexprFunctionBody(Sema &SemaRef, const FunctionDecl *Dcl,
|
|||
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,
|
||||
|
|
|
@ -1392,7 +1392,7 @@ static void checkEnumArithmeticConversions(Sema &S, Expr *LHS, Expr *RHS,
|
|||
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;
|
||||
|
@ -1405,23 +1405,23 @@ static void checkEnumArithmeticConversions(Sema &S, Expr *LHS, Expr *RHS,
|
|||
// 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()
|
||||
|
@ -1773,13 +1773,13 @@ Sema::ActOnStringLiteral(ArrayRef<Token> StringToks, Scope *UDLScope) {
|
|||
// 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) {
|
||||
|
|
|
@ -1093,7 +1093,7 @@ void InitListChecker::CheckImplicitInitList(const InitializedEntity &Entity,
|
|||
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;
|
||||
}
|
||||
}
|
||||
|
@ -1236,7 +1236,7 @@ void InitListChecker::CheckExplicitInitList(const InitializedEntity &Entity,
|
|||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1054,7 +1054,7 @@ void Sema::ActOnStartOfLambdaDefinition(LambdaIntroducer &Intro,
|
|||
// 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:
|
||||
|
|
Loading…
Reference in New Issue