================
@@ -3764,6 +3764,23 @@ void DecompositionDecl::printName(llvm::raw_ostream &OS,
   OS << ']';
 }
 
+const VarDecl *DecompositionDecl::getOriginalVar() const {
----------------
alexey-bataev wrote:

Only handles DeclRefExpr and single-arg CXXConstructExpr wrapping a 
DeclRefExpr. Misses common cases:
```
auto [a, b] = make_point();          // CallExpr
auto [a, b] = Point{1, 2};             // InitListExpr / BraceInit
auto [a, b] = std::move(p);           // CXXStdInitializerList / cast chain
```
When getOriginalVar() returns nullptr, MapBaseChecker falls back to mapping the 
DecompositionDecl itself. That may produce redundant or incorrect target maps 
compared to mapping the underlying object. Do we diagnose such cases?

https://github.com/llvm/llvm-project/pull/190832
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to