diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2010-10-06 17:00:02 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2010-10-06 17:00:02 +0000 |
commit | 730e175910936eae49e65caea8b2ba81c67edff7 (patch) | |
tree | 20726e68a34c14e76480bc5888c946440a21189f /lib/Sema/SemaType.cpp | |
parent | a0750768718bb5d05150641b5bba74847a21bc09 (diff) |
Issue deprecated warning when typeof uses typedef
based on underlying type's deprecatedness.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115800 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaType.cpp')
-rw-r--r-- | lib/Sema/SemaType.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp index 4d1256577d..b86dce06b4 100644 --- a/lib/Sema/SemaType.cpp +++ b/lib/Sema/SemaType.cpp @@ -339,6 +339,10 @@ static QualType ConvertDeclSpecToType(Sema &TheSema, // FIXME: Preserve type source info. Result = TheSema.GetTypeFromParser(DS.getRepAsType()); assert(!Result.isNull() && "Didn't get a type for typeof?"); + if (!Result->isDependentType()) + if (const TagType *TT = Result->getAs<TagType>()) + TheSema.DiagnoseUseOfDecl(TT->getDecl(), + DS.getTypeSpecTypeLoc()); // TypeQuals handled by caller. Result = Context.getTypeOfType(Result); break; @@ -2213,7 +2217,6 @@ QualType Sema::BuildTypeofExprType(Expr *E) { } if (!E->isTypeDependent()) { QualType T = E->getType(); - // FIXME. Issue warning for types built from deprecated types as well. if (const TagType *TT = T->getAs<TagType>()) DiagnoseUseOfDecl(TT->getDecl(), E->getExprLoc()); } |