| Issue |
71332
|
| Summary |
Declaring by value parameter `const` makes clang complain about ambiguity despite constraint
|
| Labels |
clang
|
| Assignees |
|
| Reporter |
davidstone
|
The following valid code:
```cpp
template<typename T> requires true
bool f(T const);
template<typename T>
bool f(T);
bool b = f(0);
```
causes clang to give an error of:
```shell
<source>:6:10: error: call to 'f' is ambiguous
6 | bool b = f(0);
| ^
<source>:2:6: note: candidate function [with T = int]
2 | bool f(T const);
| ^
<source>:4:6: note: candidate function [with T = int]
4 | bool f(T);
| ^
1 error generated.
Compiler returned: 1
```
See it live: https://godbolt.org/z/4vbhcGMca
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs