llvm-capstone/clang/test/Analysis/structured_bindings.cc
George Karpenkov 065962375d [analyzer] Don't crash with assertion failure on structured bindings
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

llvm-svn: 326951
2018-03-07 22:20:35 +00:00

11 lines
202 B
C++

// 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) {
}
}