]> granicus.if.org Git - clang/commit
[Preprocessor] Prevent expansion of y in x ## y when x is empty
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Sat, 25 May 2013 01:35:18 +0000 (01:35 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Sat, 25 May 2013 01:35:18 +0000 (01:35 +0000)
commit461f2d820ffb628ebdf6ef4a4474a43f8ff914e5
tree14a14c81fef9161adf339ffe49823cc21d693bec
parent45e1f0e3e7a2030e2e95863cf2bcceb7eb2476ff
[Preprocessor] Prevent expansion of y in x ## y when x is empty

When x is empty, x ## is suppressed, and when y gets expanded, the fact that it follows ## is not
available in the macro expansion result. The macro definition can be checked instead, the ## will
be available there regardless of what x expands to.

Fixes http://llvm.org/PR12767

Patch by Harald van Dijk!

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