@@ -1226,8 +1226,8 @@ static void handlePreferredName(Sema &S, Decl *D, const ParsedAttr &AL) {
1226
1226
}
1227
1227
}
1228
1228
1229
- S.Diag (AL.getLoc (), diag::err_attribute_preferred_name_arg_invalid )
1230
- << T << CTD;
1229
+ S.Diag (AL.getLoc (), diag::err_attribute_not_typedef_for_specialization )
1230
+ << T << AL << CTD;
1231
1231
if (const auto *TT = T->getAs <TypedefType>())
1232
1232
S.Diag (TT->getDecl ()->getLocation (), diag::note_entity_declared_at)
1233
1233
<< TT->getDecl ();
@@ -4194,8 +4194,9 @@ static void handleCallbackAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
4194
4194
}
4195
4195
4196
4196
if (CalleeFnProtoType->getNumParams () != EncodingIndices.size () - 1 ) {
4197
- S.Diag (AL.getLoc (), diag::err_callback_attribute_wrong_arg_count)
4198
- << QualType{CalleeFnProtoType, 0 } << CalleeFnProtoType->getNumParams ()
4197
+ S.Diag (AL.getLoc (), diag::err_attribute_wrong_arg_count_for_func)
4198
+ << AL << QualType{CalleeFnProtoType, 0 }
4199
+ << CalleeFnProtoType->getNumParams ()
4199
4200
<< (unsigned )(EncodingIndices.size () - 1 );
4200
4201
return ;
4201
4202
}
@@ -8020,9 +8021,7 @@ void Sema::checkUnusedDeclAttributes(Declarator &D) {
8020
8021
}
8021
8022
8022
8023
void Sema::DiagnoseUnknownAttribute (const ParsedAttr &AL) {
8023
- std::string NormalizedFullName = ' \' ' + AL.getNormalizedFullName () + ' \' ' ;
8024
8024
SourceRange NR = AL.getNormalizedRange ();
8025
-
8026
8025
StringRef ScopeName = AL.getNormalizedScopeName ();
8027
8026
std::optional<StringRef> CorrectedScopeName =
8028
8027
AL.tryGetCorrectedScopeName (ScopeName);
@@ -8044,7 +8043,7 @@ void Sema::DiagnoseUnknownAttribute(const ParsedAttr &AL) {
8044
8043
Diag (CorrectedScopeName ? NR.getBegin () : AL.getRange ().getBegin (),
8045
8044
diag::warn_unknown_attribute_ignored_suggestion);
8046
8045
8047
- D << NormalizedFullName << CorrectedFullName;
8046
+ D << AL << CorrectedFullName;
8048
8047
8049
8048
if (AL.isExplicitScope ()) {
8050
8049
D << FixItHint::CreateReplacement (NR, CorrectedFullName) << NR;
@@ -8058,8 +8057,7 @@ void Sema::DiagnoseUnknownAttribute(const ParsedAttr &AL) {
8058
8057
}
8059
8058
}
8060
8059
} else {
8061
- Diag (NR.getBegin (), diag::warn_unknown_attribute_ignored)
8062
- << NormalizedFullName << NR;
8060
+ Diag (NR.getBegin (), diag::warn_unknown_attribute_ignored) << AL << NR;
8063
8061
}
8064
8062
}
8065
8063
0 commit comments