]> granicus.if.org Git - clang/commit
Fix whitespace handling in ## operator
authorJustin Bogner <mail@justinbogner.com>
Tue, 4 Feb 2014 19:18:28 +0000 (19:18 +0000)
committerJustin Bogner <mail@justinbogner.com>
Tue, 4 Feb 2014 19:18:28 +0000 (19:18 +0000)
commit2b307d01584f8844e18321145ec76c5290054dcd
tree8f0962bb86ff3db30bf9bbb280e279a9a7b064a5
parente847967b4f2ce737877cf80c45bcd2a289aa854e
Fix whitespace handling in ## operator

In x ## y, where x and y are regular tokens, whitespace between x and ##
is ignored, and whitespace between ## and y is also ignored. When either
x or y is a function argument, whitespace was preserved, but it should
not be. This patch removes the checks for whitespace before ## and
before y, and in the special case where x is an empty macro argument and
y is a regular token, actively removes whitespace before y.

One existing test is affected by that change, but as clang's output now
matches the standard's requirements and that of GCC, I've tweaked the
testcase.

Patch by Harald van Dijk!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200785 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Lex/TokenLexer.cpp
test/Preprocessor/macro_paste_commaext.c
test/Preprocessor/macro_paste_spacing.c