[PATCH] Whitespace issues during preprocessing

Justin Bogner mail at justinbogner.com
Tue Feb 4 11:25:00 PST 2014


Harald van Dijk <harald at gigawatt.nl> writes:
> Attached are my updated patches intended to fix various whitespace
> issues in clang, modified to take Justin Bogner's comments into account.
> They are intended to ensure that whitespace is not inappropriately
> removed just because a macro or macro argument expansion is empty, and
> does get removed during token pasting.

I've committed the first four patches for you: r200785 through r200788.

> I have moved the handling of invalid token pastes from
> TokenLexer::ExpandFunctionArguments to TokenLexer::Lex, so that it works
> for both object- and function-like macros, and both when ##'s operands
> use macro parameters and when they don't.

Given that the tests needed to be changed and the behaviour clearly
hasn't followed the comment in a while, I'm not entirely convinced this
is the right thing to do. Could the comment simply be wrong? Are people
relying on one behaviour or the other for invalid token pastes in
assembler-with-cpp?

Basically, is there a way to objectively say one of these behaviours is
better than the other?



More information about the cfe-commits mailing list