C++ structured bindings for non-tuple-types are defined in a peculiar way, where the resulting declaration is not a VarDecl, but a BindingDecl.
That means a lot of existing machinery stops working.
Fortunately, the parent of a BindingDecl, the DecompositionDecl *is* a VarDecl, but it seems there's no direct way to get a pointer from a BindingDecl to a DecompositionDecl.
Applying this patch should be very safe: the behavior for VarDecl's remains the same, the behavior for binding decls would be either fixed, or in the worst case we would say that the variable is always dead.
Note that the patch should not cause crashes even if pre-processing computation fails, as all usages of bindingParentMap are guarded against.
rdar://36912381
I want a comment here. Why can BindingDecl's killability be derived from the parent DecompositionDecl's killability?