考慮如下情形:html
#define func(type, x, y) spa
int a = 1;orm
int b = 2htm
if (a > b)blog
func(int, a, b);get
else{type tmp = x; x = y; y = tmp;}it
std::cout<<"Hello, World!"<<std::endl;編譯
這種狀況下, func 被調用的時候,語句的末尾有個分號。編譯預處理之後會變成以下狀況:ast
int a = 1;co
int b = 2
if (a > b)
{type tmp = x; x = y; y = tmp;};
else
std::cout<<"Hello, World!"<<std::endl;
編譯時會報錯
參考連接:http://www.cnblogs.com/bastard/archive/2011/11/24/2262195.html