MSVC 19.28 rejects the following code with the error message: C2668 ambiguous call to overloaded function A::Foo
.
Is it a compiler bug? It compiles fine with gcc, clang and even msvc 19.10.
It fails since MSVC 19.14, see here
#include <iostream>
class A {
public:
template<typename T>
void Foo(int = {}) {
std::cout << "Hello World";
}
template<typename... T, typename... Args>
void Foo(Args&&... args) {
}
};
int main()
{
A a;
a.Foo<int>();
}