fork(1) download
  1. template <typename T> struct Base {};
  2.  
  3. template <typename T> struct Derived : Base<T>{
  4. typedef Base<T> Base;
  5. };
  6.  
  7. int main() {
  8. Derived<int> d;
  9. }
  10.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:4:21: error: declaration of ‘typedef struct Base<T> Derived<T>::Base’ [-fpermissive]
     typedef Base<T> Base;
                     ^
prog.cpp:1:30: error: changes meaning of ‘Base’ from ‘struct Base<T>’ [-fpermissive]
 template <typename T> struct Base {};
                              ^
prog.cpp: In function ‘int main()’:
prog.cpp:8:18: warning: unused variable ‘d’ [-Wunused-variable]
     Derived<int> d;
                  ^
stdout
Standard output is empty