r295548 - [analyzer] Revert 295545. There are buildbot failures.
Daniel Marjamaki via cfe-commits
cfe-commits at lists.llvm.org
Sat Feb 18 08:31:35 PST 2017
Author: danielmarjamaki
Date: Sat Feb 18 10:31:35 2017
New Revision: 295548
URL: http://llvm.org/viewvc/llvm-project?rev=295548&view=rev
Log:
[analyzer] Revert 295545. There are buildbot failures.
Modified:
cfe/trunk/lib/StaticAnalyzer/Checkers/CastToStructChecker.cpp
cfe/trunk/test/Analysis/cast-to-struct.cpp
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/CastToStructChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/CastToStructChecker.cpp?rev=295548&r1=295547&r2=295548&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/CastToStructChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/CastToStructChecker.cpp Sat Feb 18 10:31:35 2017
@@ -84,13 +84,6 @@ bool CastToStructVisitor::VisitCastExpr(
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;
Modified: cfe/trunk/test/Analysis/cast-to-struct.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/cast-to-struct.cpp?rev=295548&r1=295547&r2=295548&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/cast-to-struct.cpp (original)
+++ cfe/trunk/test/Analysis/cast-to-struct.cpp Sat Feb 18 10:31:35 2017
@@ -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;
-}
More information about the cfe-commits
mailing list