fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. template <typename T>
  5. struct Foo : T { int x; };
  6.  
  7. struct Bar { int y; };
  8.  
  9. int main() {
  10. Bar* x = new Foo<Bar>();
  11. std::cout << x->x;
  12. // your code goes here
  13. return 0;
  14. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:11:18: error: ‘struct Bar’ has no member named ‘x’
  std::cout << x->x;
                  ^
stdout
Standard output is empty