I got some ill-formed code like the following, but it builds with MSVC 19.32.31329 and /std:c++latest.
#include <Windows.h>
template<typename T>
void foo() {
int i;
// Can be anything that looks like a function call
baz(i.str());
}
int WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
int i;
// The following line is wrong because i has an integral type
// and doesn't have .str().
i.str();
}
The code is clearly wrong and shouldn't compile, but it does. Is this a compiler bug?