forked from OSchip/llvm-project
Removed an unnecessary %select from the alignas diagnostics. The attribute already knows how it was spelled.
llvm-svn: 198375
This commit is contained in:
parent
eba457c2f8
commit
3d216a579c
|
@ -1815,14 +1815,11 @@ def err_attribute_unsupported : Error<
|
|||
def err_aligned_attribute_argument_not_int : Error<
|
||||
"'aligned' attribute requires integer constant">;
|
||||
def err_alignas_attribute_wrong_decl_type : Error<
|
||||
"'%select{alignas|_Alignas}0' attribute cannot be applied to a %select{"
|
||||
"function parameter|variable with 'register' storage class|"
|
||||
"'catch' variable|bit-field}1">;
|
||||
"%0 attribute cannot be applied to a %select{function parameter|"
|
||||
"variable with 'register' storage class|'catch' variable|bit-field}1">;
|
||||
def err_alignas_missing_on_definition : Error<
|
||||
"'%select{alignas|_Alignas}0' must be specified on definition if it is "
|
||||
"specified on any declaration">;
|
||||
def note_alignas_on_declaration : Note<
|
||||
"declared with '%select{alignas|_Alignas}0' attribute here">;
|
||||
"%0 must be specified on definition if it is specified on any declaration">;
|
||||
def note_alignas_on_declaration : Note<"declared with %0 attribute here">;
|
||||
def err_alignas_mismatch : Error<
|
||||
"redeclaration has different alignment requirement (%1 vs %0)">;
|
||||
def err_alignas_underaligned : Error<
|
||||
|
|
|
@ -1937,9 +1937,9 @@ static bool mergeAlignedAttrs(Sema &S, NamedDecl *New, Decl *Old) {
|
|||
// specifier, any other declaration of that object shall also
|
||||
// have no alignment specifier.
|
||||
S.Diag(New->getLocation(), diag::err_alignas_missing_on_definition)
|
||||
<< OldAlignasAttr->isC11();
|
||||
<< OldAlignasAttr;
|
||||
S.Diag(OldAlignasAttr->getLocation(), diag::note_alignas_on_declaration)
|
||||
<< OldAlignasAttr->isC11();
|
||||
<< OldAlignasAttr;
|
||||
}
|
||||
|
||||
bool AnyAdded = false;
|
||||
|
@ -2095,9 +2095,9 @@ static void checkNewAttributesAfterDef(Sema &S, Decl *New, const Decl *Old) {
|
|||
// specifier, any other declaration of that object shall also
|
||||
// have no alignment specifier.
|
||||
S.Diag(Def->getLocation(), diag::err_alignas_missing_on_definition)
|
||||
<< AA->isC11();
|
||||
<< AA;
|
||||
S.Diag(NewAttribute->getLocation(), diag::note_alignas_on_declaration)
|
||||
<< AA->isC11();
|
||||
<< AA;
|
||||
NewAttributes.erase(NewAttributes.begin() + I);
|
||||
--E;
|
||||
continue;
|
||||
|
|
|
@ -2793,15 +2793,14 @@ void Sema::AddAlignedAttr(SourceRange AttrRange, Decl *D, Expr *E,
|
|||
if (FD->isBitField())
|
||||
DiagKind = 3;
|
||||
} else if (!isa<TagDecl>(D)) {
|
||||
Diag(AttrLoc, diag::err_attribute_wrong_decl_type)
|
||||
<< (TmpAttr.isC11() ? "'_Alignas'" : "'alignas'")
|
||||
Diag(AttrLoc, diag::err_attribute_wrong_decl_type) << &TmpAttr
|
||||
<< (TmpAttr.isC11() ? ExpectedVariableOrField
|
||||
: ExpectedVariableFieldOrTag);
|
||||
return;
|
||||
}
|
||||
if (DiagKind != -1) {
|
||||
Diag(AttrLoc, diag::err_alignas_attribute_wrong_decl_type)
|
||||
<< TmpAttr.isC11() << DiagKind;
|
||||
<< &TmpAttr << DiagKind;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue