diff options
author | John McCall <rjmccall@apple.com> | 2010-03-31 02:47:45 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-03-31 02:47:45 +0000 |
commit | aec586056d8670c99ba7c4833be13e4eb123cddb (patch) | |
tree | 473ef4f8a0cf4c5c08ebd2599bc2854feaef9401 /lib/Sema/SemaDeclAttr.cpp | |
parent | 7727acf243ee61c0757d86c95b69dbee56a3d898 (diff) |
Support __attribute__((unused)) on types. This suddenly started firing
a lot for me on selfhosts, I dunno why.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99981 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclAttr.cpp')
-rw-r--r-- | lib/Sema/SemaDeclAttr.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp index d12dec4561..cc24735c4a 100644 --- a/lib/Sema/SemaDeclAttr.cpp +++ b/lib/Sema/SemaDeclAttr.cpp @@ -524,7 +524,8 @@ static void HandleUnusedAttr(Decl *d, const AttributeList &Attr, Sema &S) { return; } - if (!isa<VarDecl>(d) && !isa<ObjCIvarDecl>(d) && !isFunctionOrMethod(d)) { + if (!isa<VarDecl>(d) && !isa<ObjCIvarDecl>(d) && !isFunctionOrMethod(d) && + !isa<TypeDecl>(d)) { S.Diag(Attr.getLoc(), diag::warn_attribute_wrong_decl_type) << Attr.getName() << 2 /*variable and function*/; return; |