Fun with conversion-operator name lookup
DRANK
As of this writing (but perhaps not for very much longer!) the four mainstream compilers on Godbolt Compiler Explorer give four different answers for this simple C++ program:
1 comments
#include <cstdio> struct T1 {}; struct T2 {}; struct U1 {}; struct U2 {}; struct A { using T = T1; using U = U1; operator U1 T1::* () { return 0; } operator U1 T2::* () { return 0; } operator U2 T1::* () { return 0; } operator U2 T2::* () { return 0; } }; inline auto which(U1 T1::*) { return "gcc"; } inline auto which(U1 T2::*) { return "icc"; } inline auto which(U2 T1::*) { return "msvc"; } inline auto which(U2 T2::*) { return "clang"; } int main() { A a; using T = T2; using U = U2; puts(which(a.operator U T:: * ())); }