[cfe-commits] r163022 - in /cfe/trunk: include/clang/Lex/Token.h lib/Lex/PPMacroExpansion.cpp lib/Lex/TokenLexer.cpp test/Preprocessor/microsoft-ext.c

Abramo Bagnara abramo.bagnara at bugseng.com
Thu Dec 13 00:56:45 PST 2012

Il 13/12/2012 02:17, João Matos ha scritto:
> On Thu, Dec 13, 2012 at 12:48 AM, Will Wilson <will at indefiant.com
> <mailto:will at indefiant.com>> wrote:
>     Thanks for the info Joåo. Do you think it'll be a lot of work to get
>     to get it working against the test case?
> It does not seem too hard if you understand the preprocessor code and
> concepts.
> By the way, the original test case I added is wrong, as Nico pointed out
> earlier.
> If someone wants to work on it, this is one test case that shows the
> problem:

The following testcase can show the different behaviors: for msvc p2_
invocation is wrong while for other compilers p1_ invocation is wrong.

It seems that msvc is not standard conformant and that keep comma
expanded argument containing comma as a single argument also after the
first expansion.

#define p1_(x) x
#define p1(x) p1_(x)
#define p2_(x,y) x/y
#define p2(x) p2_(x)
#define pair a,b



Abramo Bagnara

BUGSENG srl - http://bugseng.com
mailto:abramo.bagnara at bugseng.com

More information about the cfe-commits mailing list