On cppreference.com, the following code is provided as example explaining dependent name resolution:
#include <iostream>
void g(double) { std::cout << "g(double)\n"; }
template<class T>
struct S {
void f() const {
g(1); // "g" is a non-dependent name, bound now
}
};
void g(int) { std::cout << "g(int)\n"; }
int main()
{
g(1); // calls g(int)
S<int> s;
s.f(); // calls g(double)
}
The current version of Visual C++ (19.0.23918.0) produces the following output:
g(int)
g(int)
Is this allowed by the standard, or is it a bug in MSVC?