fork(2) download
  1. #include <iostream>
  2.  
  3.  
  4. namespace Z {
  5. struct X {};
  6. }
  7.  
  8.  
  9. template <class T>
  10. void bar(T t)
  11. {
  12. foo(t);
  13. }
  14.  
  15.  
  16. void foo(Z::X x)
  17. {
  18. std::cout << "Foo\n";
  19. }
  20.  
  21. int main()
  22. {
  23. Z::X x;
  24. bar(x);
  25. }
Compilation error #stdin compilation error #stdout 0s 3296KB
stdin
Standard input is empty
compilation info
prog.cpp: In instantiation of ‘void bar(T) [with T = Z::X]’:
prog.cpp:24:7:   required from here
prog.cpp:12:7: error: ‘foo’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
  foo(t);
       ^
prog.cpp:16:6: note: ‘void foo(Z::X)’ declared here, later in the translation unit
 void foo(Z::X x)
      ^
stdout
Standard output is empty