fork download
  1. template <typename U> class nest1 {};
  2.  
  3. class cls {
  4. public:
  5. template <typename V> class nest1 {};
  6.  
  7. template <typename W> class nest2 {
  8. public:
  9. void bar(nest1<W> x);
  10. };
  11. };
  12.  
  13.  
  14. template <typename W>
  15. void cls::nest2<W>::bar(nest1<W> x) {}
  16.  
  17.  
  18. int main(int argc, const char* argv[]) {
  19. cls::nest1<int> x;
  20. nest2<int> y;
  21. y.bar(x);
  22.  
  23. return 0;
  24. }
  25.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main(int, const char**)’:
prog.cpp:20:2: error: ‘nest2’ was not declared in this scope
prog.cpp:20:8: error: expected primary-expression before ‘int’
prog.cpp:20:8: error: expected ‘;’ before ‘int’
prog.cpp:21:2: error: ‘y’ was not declared in this scope
stdout
Standard output is empty