Proper modeling still remains to be done.
Note that BindingDecl#getHoldingVar() is almost always null, and this
should probably be handled by dealing with DecompositionDecl beforehand.
rdar://
36852163
Differential Revision: https://reviews.llvm.org/D44183
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@326951
91177308-0d34-0410-b5e6-
96231b3b80d8
currBldrCtx->blockCount());
state = state->assume(V.castAs<DefinedOrUnknownSVal>(), true);
Bldr.generateNode(Ex, Pred, state->BindExpr(Ex, LCtx, V), nullptr,
- ProgramPoint::PostLValueKind);
+ ProgramPoint::PostLValueKind);
+ return;
+ }
+ if (const auto* BD = dyn_cast<BindingDecl>(D)) {
+ // FIXME: proper support for bound declarations.
+ // For now, let's just prevent crashing.
return;
}
--- /dev/null
+// RUN: %clang_analyze_cc1 -std=c++17 -analyzer-checker=core -verify %s
+
+// expected-no-diagnostics
+struct s { int a; };
+int foo() {
+ auto[a] = s{1}; // FIXME: proper modelling
+ if (a) {
+ }
+}
+