aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/CheckSizeofPointer.cpp
diff options
context:
space:
mode:
authorZhongxing Xu <xuzhongxing@gmail.com>2009-11-10 04:20:20 +0000
committerZhongxing Xu <xuzhongxing@gmail.com>2009-11-10 04:20:20 +0000
commit52cb277a1f4303f68a40112797cee86a138ef89b (patch)
tree7f56e13ff9b23b8ea736be999b35d35bd8beaed5 /lib/Analysis/CheckSizeofPointer.cpp
parent4881b99bc830d4432c171b0a00348711bb863eea (diff)
SizeofPointerChecker: If an explicit type specifier is used, do not issue warnings.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86662 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/CheckSizeofPointer.cpp')
-rw-r--r--lib/Analysis/CheckSizeofPointer.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Analysis/CheckSizeofPointer.cpp b/lib/Analysis/CheckSizeofPointer.cpp
index 80a2a18c08..ada6082dd2 100644
--- a/lib/Analysis/CheckSizeofPointer.cpp
+++ b/lib/Analysis/CheckSizeofPointer.cpp
@@ -42,6 +42,11 @@ void WalkAST::VisitSizeOfAlignOfExpr(SizeOfAlignOfExpr *E) {
if (!E->isSizeOf())
return;
+ // If an explicit type is used in the code, usually the coder knows what he is
+ // doing.
+ if (E->isArgumentType())
+ return;
+
QualType T = E->getTypeOfArgument();
if (T->isPointerType()) {
SourceRange R = E->getSourceRange();