The case when the bound variable is reference type in a BindingDecl wasn't handled, which lead to false positives.
Details
Diff Detail
Event Timeline
clang/test/Analysis/structured_bindings.cpp | ||
---|---|---|
20 | I wouldn't use function main unless the tests needs specifically that. |
I tried poking this from a few directions, like nasty GNU extension types, ObjCObjectPointerType, but those seem orthogonal to this patch. Looks great! I'd wait for someone else's approval as well, as I try my best to pick up the thread.
clang/lib/StaticAnalyzer/Core/ExprEngine.cpp | ||
---|---|---|
2631 | I think a few words might be nice here. It may not be obvious to everyone that the binding is never a reference (https://eel.is/c++draft/dcl.struct.bind#note-1). |
clang/test/Analysis/structured_bindings.cpp | ||
---|---|---|
26 | I think we could have a test case where we modify the value of i through x and check that the value of i changed to make sure they actually point to the same memory location, not just happen to have same value. |
I think a few words might be nice here. It may not be obvious to everyone that the binding is never a reference (https://eel.is/c++draft/dcl.struct.bind#note-1).