aboutsummaryrefslogtreecommitdiff
path: root/lib/Lex/Preprocessor.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2012-06-29 18:27:59 +0000
committerDouglas Gregor <dgregor@apple.com>2012-06-29 18:27:59 +0000
commit193f91ba7ed28709a1e730aedb3582353f9075d0 (patch)
treef40c6d9aad9bc1ea08d6d636d9750d0c5e9f482e /lib/Lex/Preprocessor.cpp
parentbe8d55ce4a20b86d9337dcb28759e068cb3510f3 (diff)
Patch for handling C99 veriadic macros when using precompiled headers,
from Filipe Cabecinhas! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159446 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/Preprocessor.cpp')
-rw-r--r--lib/Lex/Preprocessor.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/Lex/Preprocessor.cpp b/lib/Lex/Preprocessor.cpp
index 70be2cf7a6..c699c4a790 100644
--- a/lib/Lex/Preprocessor.cpp
+++ b/lib/Lex/Preprocessor.cpp
@@ -515,9 +515,19 @@ void Preprocessor::HandleIdentifier(Token &Identifier) {
// If the information about this identifier is out of date, update it from
// the external source.
+ // We have to treat __VA_ARGS__ in a special way, since it gets
+ // serialized with isPoisoned = true, but our preprocessor may have
+ // unpoisoned it if we're defining a C99 macro.
if (II.isOutOfDate()) {
+ bool CurrentIsPoisoned = false;
+ if (&II == Ident__VA_ARGS__)
+ CurrentIsPoisoned = Ident__VA_ARGS__->isPoisoned();
+
ExternalSource->updateOutOfDateIdentifier(II);
Identifier.setKind(II.getTokenID());
+
+ if (&II == Ident__VA_ARGS__)
+ II.setIsPoisoned(CurrentIsPoisoned);
}
// If this identifier was poisoned, and if it was not produced from a macro