The preprocessor, which means whatever the editor sees might have a complete different meaning. There are people that make all sorts of dirty tricks with the C and C++ preprocessor.
C++'s grammar is not context free, so you really need a compiler frontend to make sure the refactored code isn't broken.