fork download
  1. #define If_Helper_0(True)
  2. #define If_Helper_1(True) True
  3. #define If(Bit, True) If_Helper_ ## Bit (True)
  4.  
  5. #define Id2(Arg1, Arg2) Arg1, Arg2
  6.  
  7. int main()
  8. {
  9. If(1, Id2(int a, b));
  10. a = b = 42;
  11. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:9:1: error: macro "If_Helper_1" passed 2 arguments, but takes just 1
  If(1, Id2(int a, b));
 ^
prog.cpp: In function ‘int main()’:
prog.cpp:3:23: error: ‘If_Helper_1’ was not declared in this scope
 #define If(Bit, True) If_Helper_ ## Bit (True)
                       ^
prog.cpp:9:2: note: in expansion of macro ‘If’
  If(1, Id2(int a, b));
  ^
prog.cpp:10:2: error: ‘a’ was not declared in this scope
  a = b = 42;
  ^
prog.cpp:10:6: error: ‘b’ was not declared in this scope
  a = b = 42;
      ^
stdout
Standard output is empty