[clang] [clang] return type not correctly deduced for discarded lambdas (PR #153921)

Matheus Izvekov via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 15 21:35:34 PDT 2025


mizvekov wrote:

Yeah this is not correct, simply removing that return statement will cause us to attempt to use a discarded return statement for return type deduction purposes, but that is not supposed to happen.

That return statement is discarded, so perhaps you should return something which will not cause further errors as well.

I haven't fully reviewed the change that caused the regression, but I'd suspect you could extend the return statement with info about it being discarded.

https://github.com/llvm/llvm-project/pull/153921


More information about the cfe-commits mailing list