Fix token pasting with -ftrack-macro-expansion
authorDodji Seketeli <dodji@redhat.com>
Mon, 30 Apr 2012 11:41:21 +0000 (11:41 +0000)
committerDodji Seketeli <dodji@gcc.gnu.org>
Mon, 30 Apr 2012 11:41:21 +0000 (13:41 +0200)
commit0ff2b8a0225c3b1adeb0ebde107b7f30ba9e2fd1
tree1d4cb06aa5ecf72c6a60528b1d81bb97c5bb8175
parent4e65a47055ed1e7fb0068125bd95708ed86ab9af
Fix token pasting with -ftrack-macro-expansion

This patch makes token pasting work with -ftrack-macro-expansion
turned on.  It improves some pasting related tests of the gcc.dg/cpp
subdirectory.

Tested and bootstrapped on x86_64-unknown-linux-gnu against trunk.

Note that the bootstrap with -ftrack-macro-expansion exhibits other
separate issues that are addressed in subsequent patches.  This patch
just fixes one class of problems.

The patch does pass bootstrap with -ftrack-macro-expansion turned off,
though.

libcpp/

* macro.c (paste_all_tokens): Put the token resulting from pasting
into an extended token context with -ftrack-macro-location is in
effect.

gcc/testsuite/

* gcc.dg/cpp/paste17.c: New test case for
-ftrack-macro-expansion=2 mode only.
* gcc.dg/cpp/macro-exp-tracking-5.c: Likewise.

From-SVN: r186966
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/cpp/macro-exp-tracking-5.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/cpp/paste17.c [new file with mode: 0644]
libcpp/ChangeLog
libcpp/macro.c