fork download
  1. template <typename T>
  2. struct base {
  3. template <typename S>
  4. struct nested {
  5. };
  6. };
  7.  
  8. template <typename T>
  9. struct derived: base<T> {
  10. void foo() {
  11. nested<T> obj;
  12. }
  13. };
  14.  
  15. int main() {
  16. derived<int>().foo();
  17. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In member function ‘void derived<T>::foo()’:
prog.cpp:11:9: error: ‘nested’ was not declared in this scope
         nested<T> obj;
         ^
prog.cpp:11:17: error: expected primary-expression before ‘>’ token
         nested<T> obj;
                 ^
prog.cpp:11:19: error: ‘obj’ was not declared in this scope
         nested<T> obj;
                   ^
stdout
Standard output is empty