According to Godbolt, this code compiles with MSVC but not with GCC and Clang [conformance view]. Which one is right and why?
#include <iostream>
void Example (){
std::cout << "function";
}
class Example{
public: Example() {
std::cout << "constructor";
}
};
int main()
{
Example();
class Example();
}
I understand that the function will be preferred, which is why I wrote class
in the second line.