1 2 3 4 5 6 7 8 | #include <iostream> void operator>>(std::istream&, const char*); namespace n { struct SomeClass { friend void operator>>(std::istream&, SomeClass&){}} ; int m() { std::cin >> "c"; SomeClass sc; std::cin >> sc; } } |
I2luY2x1ZGUgPGlvc3RyZWFtPgp2b2lkIG9wZXJhdG9yPj4oc3RkOjppc3RyZWFtJiwgY29uc3QgY2hhciopOwoKbmFtZXNwYWNlIG4gewogIHN0cnVjdCBTb21lQ2xhc3MgeyBmcmllbmQgICB2b2lkIG9wZXJhdG9yPj4oc3RkOjppc3RyZWFtJiwgU29tZUNsYXNzJil7fX0gOwoKICBpbnQgbSgpIHsgc3RkOjpjaW4gPj4gImMiOyBTb21lQ2xhc3Mgc2M7IHN0ZDo6Y2luID4+IHNjOyB9Cn0=
prog.cpp: In function ‘int n::m()’: prog.cpp:7: warning: control reaches end of non-void function /usr/lib/gcc/i686-pc-linux-gnu/4.3.4/../../../crt1.o: In function `_start': (.text+0x18): undefined reference to `main' /home/Ts3Rdo/ccdtEE1O.o: In function `n::m()': prog.cpp:(.text+0x43): undefined reference to `operator>>(std::basic_istream<char, std::char_traits<char> >&, char const*)' collect2: ld returned 1 exit status
-
result: Compilation error (maybe you wish to see an example for C++ 4.7.2)


