[clang] Rejects valid deducing return type with expansion statement
Open
c++26
clang:frontend
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
https://godbolt.org/z/zcE5TbKzn
```c++
auto f() {
template for (auto x : {}) {
return 3;
}
return 1.3;
}
```
```
:5:3: error: 'auto' in return type deduced as 'double' here but deduced as 'int' in earlier return statement
5 | return 1.3;
| ^
1 error generated.
```
This should be valid because after expansion the function only contains one "return".
CC @Sirraide
Contributor guide
Assessment
This issue has not been assessed yet.