]> granicus.if.org Git - clang/commitdiff
[analyzer] Revert 295545. There are buildbot failures.
authorDaniel Marjamaki <daniel.marjamaki@evidente.se>
Sat, 18 Feb 2017 16:31:35 +0000 (16:31 +0000)
committerDaniel Marjamaki <daniel.marjamaki@evidente.se>
Sat, 18 Feb 2017 16:31:35 +0000 (16:31 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@295548 91177308-0d34-0410-b5e6-96231b3b80d8

lib/StaticAnalyzer/Checkers/CastToStructChecker.cpp
test/Analysis/cast-to-struct.cpp

index c2880bc215712432df95f5c53fd88865cd29984f..16a475ae9dd21e855b08168059cd13e17e9f225d 100644 (file)
@@ -84,13 +84,6 @@ bool CastToStructVisitor::VisitCastExpr(const CastExpr *CE) {
     if (!VD || VD->getType()->isReferenceType())
       return true;
 
-    // Don't warn when target type has no definition.
-    if (const RecordType *RD = dyn_cast<RecordType>(ToPointeeTy.getTypePtr())) {
-      if (!RD->getDecl()->getDefinition()) {
-        return true;
-      }
-    }
-
     // Warn when there is widening cast.
     unsigned ToWidth = Ctx.getTypeInfo(ToPointeeTy).Width;
     unsigned OrigWidth = Ctx.getTypeInfo(OrigPointeeTy).Width;
index 6c23c2bf48d03eb6d73e642490e1b6f0f2b264eb..45d55947c9377991250de9c9383de512764f36d1 100644 (file)
@@ -65,8 +65,3 @@ void intToStruct(int *P) {
   void *VP = P;
   Abc = (struct ABC *)VP;
 }
-
-// https://llvm.org/bugs/show_bug.cgi?id=31173
-void dontCrash(struct AB X) {
-  struct UndefS *S = (struct UndefS *)&X;
-}