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

Oliver Hunt via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 15 22:21:55 PDT 2025


ojhunt wrote:

> Yes the correct behavior for return type deduction for a function with no non-discarded return statements is for it to be deduced as void: https://godbolt.org/z/qaYebb5q9

Right, once you pointed it out I remembered that not all of the semantic/erroneous code in discarded statements is considered relevant, and once that was there the behavior of the return type deduction is consistent and reasonable, all things considered.

I'm still confused by how it is the return type is a bool though.

I'm unsure what the distinction between deduced vs inferred return types is because from my FL days those mean the same thing :D


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


More information about the cfe-commits mailing list