From 0dfa81d5f5ce55ab3ff991cba9f80005e267268b Mon Sep 17 00:00:00 2001 From: Daniel Marjamaki Date: Sat, 18 Feb 2017 16:31:35 +0000 Subject: [PATCH] [analyzer] Revert 295545. There are buildbot failures. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@295548 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/StaticAnalyzer/Checkers/CastToStructChecker.cpp | 7 ------- test/Analysis/cast-to-struct.cpp | 5 ----- 2 files changed, 12 deletions(-) diff --git a/lib/StaticAnalyzer/Checkers/CastToStructChecker.cpp b/lib/StaticAnalyzer/Checkers/CastToStructChecker.cpp index c2880bc215..16a475ae9d 100644 --- a/lib/StaticAnalyzer/Checkers/CastToStructChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/CastToStructChecker.cpp @@ -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(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; diff --git a/test/Analysis/cast-to-struct.cpp b/test/Analysis/cast-to-struct.cpp index 6c23c2bf48..45d55947c9 100644 --- a/test/Analysis/cast-to-struct.cpp +++ b/test/Analysis/cast-to-struct.cpp @@ -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; -} -- 2.40.0