diff options
| author | John McCall <rjmccall@apple.com> | 2010-08-12 21:44:57 +0000 |
|---|---|---|
| committer | John McCall <rjmccall@apple.com> | 2010-08-12 21:44:57 +0000 |
| commit | 2b5c1b2516ca7e381ba00ef09787b824b30f77e6 (patch) | |
| tree | e5946f80419e7bec536817d8658f7d9f66f82624 /clang/lib/Sema/SemaExpr.cpp | |
| parent | 112fd083fafabcda3e9ead58d2359fd9e3f987c3 (diff) | |
| download | bcm5719-llvm-2b5c1b2516ca7e381ba00ef09787b824b30f77e6.tar.gz bcm5719-llvm-2b5c1b2516ca7e381ba00ef09787b824b30f77e6.zip | |
Implement -Wcast-align. The initial design of this diagnostic diverges
from GCC's in that we warn on *any* increase in alignment requirements, not
just those that are enforced by hardware. Please let us know if this causes
major problems for you (which it shouldn't, since it's an optional warning).
llvm-svn: 110959
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index 8643dd8386d..f87d39fd8f0 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -3995,6 +3995,10 @@ bool Sema::CheckCastTypes(SourceRange TyR, QualType castType, Expr *&castExpr, } Kind = getScalarCastKind(Context, castExpr->getType(), castType); + + if (Kind == CastExpr::CK_Unknown || Kind == CastExpr::CK_BitCast) + CheckCastAlign(castExpr, castType, TyR); + return false; } |

