summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/Analysis/CheckSizeofPointer.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Analysis/CheckSizeofPointer.cpp b/clang/lib/Analysis/CheckSizeofPointer.cpp
index 80a2a18c083..ada6082dd28 100644
--- a/clang/lib/Analysis/CheckSizeofPointer.cpp
+++ b/clang/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();
OpenPOWER on IntegriCloud