@@ -1868,8 +1868,8 @@ static void handleNakedAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
18681868 // This form is not allowed to be written on a member function (static or
18691869 // nonstatic) when in Microsoft compatibility mode.
18701870 if (S.getLangOpts ().MSVCCompat && isa<CXXMethodDecl>(D)) {
1871- S.Diag (AL.getLoc (), diag::err_attribute_wrong_decl_type_str )
1872- << AL << AL.isRegularKeywordAttribute () << " non-member functions " ;
1871+ S.Diag (AL.getLoc (), diag::err_attribute_wrong_decl_type )
1872+ << AL << AL.isRegularKeywordAttribute () << ExpectedNonMemberFunction ;
18731873 return ;
18741874 }
18751875 }
@@ -2761,9 +2761,9 @@ static void handleWarnUnusedResult(Sema &S, Decl *D, const ParsedAttr &AL) {
27612761 // The standard attribute cannot be applied to variable declarations such
27622762 // as a function pointer.
27632763 if (isa<VarDecl>(D))
2764- S.Diag (AL.getLoc (), diag::warn_attribute_wrong_decl_type_str )
2764+ S.Diag (AL.getLoc (), diag::warn_attribute_wrong_decl_type )
27652765 << AL << AL.isRegularKeywordAttribute ()
2766- << " functions, classes, or enumerations " ;
2766+ << ExpectedFunctionOrClassOrEnum ;
27672767
27682768 // If this is spelled as the standard C++17 attribute, but not in C++17,
27692769 // warn about using it as an extension. If there are attribute arguments,
@@ -5555,8 +5555,8 @@ static void handleNullableTypeAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
55555555
55565556 if (auto *CRD = dyn_cast<CXXRecordDecl>(D);
55575557 !CRD || !(CRD->isClass () || CRD->isStruct ())) {
5558- S.Diag (AL.getRange ().getBegin (), diag::err_attribute_wrong_decl_type_str )
5559- << AL << AL.isRegularKeywordAttribute () << " classes " ;
5558+ S.Diag (AL.getRange ().getBegin (), diag::err_attribute_wrong_decl_type )
5559+ << AL << AL.isRegularKeywordAttribute () << ExpectedClass ;
55605560 return ;
55615561 }
55625562
0 commit comments