fork download
  1. auto foo(int i) {
  2. return (i == 1) ? i : foo(i-1)+i ;
  3. }
  4.  
  5. int main()
  6. {
  7.  
  8.  
  9. }
Compilation error #stdin compilation error #stdout 0s 3292KB
stdin
Standard input is empty
compilation info
prog.cpp:1:15: warning: ‘foo’ function uses ‘auto’ type specifier without trailing return type [enabled by default]
 auto foo(int i) {
               ^
prog.cpp: In function ‘auto foo(int)’:
prog.cpp:2:25: error: use of ‘auto foo(int)’ before deduction of ‘auto’
   return (i == 1) ? i : foo(i-1)+i ;  
                         ^
stdout
Standard output is empty