================
@@ -453,7 +450,7 @@ void ClassifyRefs::VisitCallExpr(CallExpr *CE) {
const auto *UO = dyn_cast<UnaryOperator>(Ex);
if (UO && UO->getOpcode() == UO_AddrOf)
Ex = UO->getSubExpr();
- classify(Ex, Ignore);
+ classify(Ex, Use);
----------------
zygoloid wrote:
I believe the intent of this code is that if *the address of* a local variable
is passed to a const pointer, that local variable is neither considered used
nor initialized. When a local variable is passed directly to a call, no special
handling should be required, because an lvalue-to-rvalue conversion will be
performed, which will be classified as a use. So I think the correct fix is
instead:
```suggestion
if (UO && UO->getOpcode() == UO_AddrOf) {
classify(UO->getSubExpr(), Ignore);
}
```
https://github.com/llvm/llvm-project/pull/147221
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits