1 2 3 4 5 6 7 8 9 10 11 12 | struct foo { operator int() const { return 17; } }; template <typename T> T max(T x, T y); int main() { max(0, foo()); } |
c3RydWN0IGZvbyB7CiAgICBvcGVyYXRvciBpbnQoKSBjb25zdCB7IHJldHVybiAxNzsgfQp9OwoKdGVtcGxhdGUgPHR5cGVuYW1lIFQ+ClQgbWF4KFQgeCwgVCB5KTsKCmludCBtYWluKCkgewogICBtYXgoMCwgZm9vKCkpOwp9Cgo=
prog.cpp: In function ‘int main()’: prog.cpp:9: error: no matching function for call to ‘max(int, foo)’
-
result: Compilation error (maybe you wish to see an example for C++ 4.7.2)


