fork download
  1. namespace foo {
  2. namespace foo {
  3. typedef int Foo;
  4. }
  5. struct Foo {
  6. int x;
  7. Foo( foo::Foo const& o ):x(o.x) {}
  8. void test() {
  9. Foo f( 7 );
  10. }
  11. };
  12. }
  13.  
  14. int main() {
  15. foo::Foo f;
  16. f.test();
  17. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In constructor ‘foo::Foo::Foo(const Foo&)’:
prog.cpp:7:38: error: request for member ‘x’ in ‘o’, which is of non-class type ‘const Foo {aka const int}’
prog.cpp: In function ‘int main()’:
prog.cpp:15:14: error: no matching function for call to ‘foo::Foo::Foo()’
prog.cpp:15:14: note: candidates are:
prog.cpp:7:9: note: foo::Foo::Foo(const Foo&)
prog.cpp:7:9: note:   candidate expects 1 argument, 0 provided
prog.cpp:5:12: note: constexpr foo::Foo::Foo(const foo::Foo&)
prog.cpp:5:12: note:   candidate expects 1 argument, 0 provided
prog.cpp:5:12: note: constexpr foo::Foo::Foo(foo::Foo&&)
prog.cpp:5:12: note:   candidate expects 1 argument, 0 provided
stdout
Standard output is empty