fork download
  1.  
  2. #define UNKO_DISABLE
  3.  
  4. #if defined(UNKO_DISABLE)
  5. namespace { template<int n> void unko_fun() {} }
  6. # define UNKO namespace { template<> void unko_fun<__LINE__>() {
  7. # define UNKO_TRAIL }};
  8. # define UNKO_IN_FUN if ( true ) ; else
  9. #else
  10. # define UNKO
  11. # define UNKO_TRAIL
  12. # define UNKO_IN_FUN
  13. #endif
  14.  
  15.  
  16. ///////////////////////////////////////////////////////////////////////////
  17.  
  18.  
  19. UNKO int i = 0, j = 2; UNKO_TRAIL
  20. UNKO int k = 0, x = 2; UNKO_TRAIL
  21.  
  22. int main()
  23. {
  24. UNKO_IN_FUN int n = 0, m = 2;
  25.  
  26. i, j, k, x;
  27. n, m;
  28. }
  29.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘void {anonymous}::unko_fun() [with int n = 19]’:
prog.cpp:19:10: warning: unused variable ‘i’ [-Wunused-variable]
prog.cpp:19:17: warning: unused variable ‘j’ [-Wunused-variable]
prog.cpp: In function ‘void {anonymous}::unko_fun() [with int n = 20]’:
prog.cpp:20:10: warning: unused variable ‘k’ [-Wunused-variable]
prog.cpp:20:17: warning: unused variable ‘x’ [-Wunused-variable]
prog.cpp: In function ‘int main()’:
prog.cpp:24:18: warning: unused variable ‘n’ [-Wunused-variable]
prog.cpp:24:25: warning: unused variable ‘m’ [-Wunused-variable]
prog.cpp:26:2: error: ‘i’ was not declared in this scope
prog.cpp:26:5: error: ‘j’ was not declared in this scope
prog.cpp:26:8: error: ‘k’ was not declared in this scope
prog.cpp:26:11: error: ‘x’ was not declared in this scope
prog.cpp:27:2: error: ‘n’ was not declared in this scope
prog.cpp:27:5: error: ‘m’ was not declared in this scope
stdout
Standard output is empty