fork download
  1. template <typename T>
  2. struct X {
  3. auto f() -> decltype(this->g());
  4. auto g() -> decltype(this->f());
  5. };
  6.  
  7. int main {
  8. X<int> x;
  9. }
  10.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:3:24: error: invalid use of 'this' at top level
prog.cpp:3:24: error: invalid use of 'this' at top level
prog.cpp:4:24: error: invalid use of 'this' at top level
prog.cpp:4:24: error: invalid use of 'this' at top level
prog.cpp:8:10: error: expected primary-expression before 'x'
prog.cpp:8:10: error: expected '}' before 'x'
prog.cpp:8:10: error: expected ',' or ';' before 'x'
prog.cpp:9:1: error: expected declaration before '}' token
stdout

Standard output is empty