Use const auto rather than duplicating the type name and fix the
error message when the attribute is applied to an incorrect entity.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@241526
91177308-0d34-0410-b5e6-
96231b3b80d8
let Spellings = [GCC<"target">];
let Args = [StringArgument<"features">];
let Subjects =
- SubjectList<[Function], ErrorDiag, "ExpectedFunctionMethodOrClass">;
+ SubjectList<[Function], ErrorDiag, "ExpectedFunction">;
let Documentation = [Undocumented];
}
const FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(TargetDecl);
if (FD) {
- if (const TargetAttr *TD = FD->getAttr<TargetAttr>()) {
+ if (const auto *TD = FD->getAttr<TargetAttr>()) {
StringRef FeaturesStr = TD->getFeatures();
SmallVector<StringRef, 1> AttrFeatures;
FeaturesStr.split(AttrFeatures, ",");