[cfe-commits] Review: Patch for handling C99 veridic macros when using precompiled headers

Filipe Cabecinhas filcab at filcab.net
Mon Jun 25 15:22:21 PDT 2012


Hi all, 

C99 variadic macros aren't working when we use precompiled headers (either that or I made several mistakes when trying to use them).

Attached is a patch with a test-case that is not working on current clang.

I'm doing special __VA_ARGS__ handling in Preprocessor::HandleIdentifier(Token &Identifier).

What's happening:
__VA_ARGS__ is being serialized in the precompiled header and is being read when Preprocessor::HandleIdentifier calls updateOutOfDateIdentifier(II) with the recently read __VA_ARGS__ II.
The Preprocessor had set Ident__VA_ARGS__->isPoisoned to false because we're defining a C99 variadic macro, but when ASTReader updates the __VA_ARGS__ token, it sets it to what it was when writing the pch file: true.

It seemed that handling it here was better than to handle it when writing or reading the pch file.

Regards,

  Filipe

-------------- next part --------------
A non-text attachment was scrubbed...
Name: clang-__VA_ARGS__-pch-fix.patch
Type: application/octet-stream
Size: 1662 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120625/7dcc4f83/attachment.obj>


More information about the cfe-commits mailing list