Extremely cursed code of the day:
struct A {
void f(int) const;
void f(const std::string&);
};
void b() {
A a;
a.f(1); // Well-formed
a.f(0); // Ill-formed?!?!?!?
}
Godbolt: https://godbolt.org/z/qbEzz6hhv
It is worse b/c clang reject, gcc accepts w/ diagnostic and MSVC silently accepts 🤯
#Cplusplus