fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. typedef void f_type();
  5.  
  6. void foo () {}
  7.  
  8. int main() {
  9. f_type f = foo;
  10. return 0;
  11. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function 'int main()':
prog.cpp:9:9: warning: declaration of 'void f()' has 'extern' and is initialized
  f_type f = foo;
         ^
prog.cpp:9:13: error: function 'void f()' is initialized like a variable
  f_type f = foo;
             ^
stdout
Standard output is empty