[cfe-dev] Interact with the preprocessor

Chris Lattner clattner at apple.com
Tue Feb 10 14:52:58 PST 2009


On Feb 9, 2009, at 9:25 AM, Paolo Bolzoni wrote:

>
> Second example: it is always a bad idea (and it actually makes the  
> code
> ill formed) redefine a keyword. But preprocessors do not warn  
> against it.
>
> The code:
>
> #define private public
> class A { ... };
>
> violates the rule, and we'd like to be able to intercept the action
> of defining the macro in order to warn against this abuse of the
> preprocessor.  Again, the problem is undetectable in the  
> preprocessed code.

I think it would be reasonable to just make this a builtin warning in  
the normal clang preprocessor.

-Chris



More information about the cfe-dev mailing list