Issue 153884
Summary [clang] Regression in lambda return type inference
Labels c++, clang:frontend, rejects-valid, lambda, regression:21
Assignees
Reporter ojhunt
    I've found a regression in the return type inference in lambda expressions that seems fairly severe

```cpp
int v;
bool foo() {
  auto init = [](auto) { return true; };
  if constexpr (0)
    return init(v);
  return false;
}
```

This compiles in clang20 and gcc, but not in main.

I believe it to be broken in clang21 as well, but I'm not sure if I was building the correct branch so will need to re-test.

Pre-emptively tagging as a 21 regression as I am reasonably certain that it does repro and want people to see this in case they have any immediate ideas of what might be the cause before I start looking at this myself.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to