]> granicus.if.org Git - clang/commitdiff
SizeofPointerChecker: If an explicit type specifier is used, do not issue warnings.
authorZhongxing Xu <xuzhongxing@gmail.com>
Tue, 10 Nov 2009 04:20:20 +0000 (04:20 +0000)
committerZhongxing Xu <xuzhongxing@gmail.com>
Tue, 10 Nov 2009 04:20:20 +0000 (04:20 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86662 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/CheckSizeofPointer.cpp

index 80a2a18c083654f8ce1285cdcf063003286b0373..ada6082dd28e60a278a1fde9614548000e6e24b5 100644 (file)
@@ -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();