Issue |
81579
|
Summary |
ill-formed program with ambiguity of overload resolution accepted
|
Labels |
|
Assignees |
|
Reporter |
Fedr
|
This program
```
#include <vector>
struct A {};
void func(std::vector<int>) {}
void func(std::vector<A>);
int main() {
func({ 4 });
}
```
is rejected by GCC and MSVC due to `call of overloaded 'func(<brace-enclosed initializer list>)' is ambiguous`, but Clang accepts the program, which seems incorrect since there is no IFNDR here. Online demo: https://godbolt.org/z/Prz4YcsW5
Explanation why the program is ill-formed: https://stackoverflow.com/a/77979372/7325599
GCC developers support it: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113884
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs