struct MyClass { void operator-() const {} }; //void operator-(const MyClass&) {} struct Wrapper { operator MyClass() const { return MyClass(); } }; int main() { -Wrapper(); }
Standard input is empty
prog.cpp: In function ‘int main()’: prog.cpp:12:2: error: no match for ‘operator-’ (operand type is ‘Wrapper’) -Wrapper(); ^
Standard output is empty