diff options
-rw-r--r-- | lib/Serialization/ASTReader.cpp | 2 | ||||
-rw-r--r-- | test/Index/index-pch.cpp | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/Serialization/ASTReader.cpp b/lib/Serialization/ASTReader.cpp index 4c11f38395..24073df3ec 100644 --- a/lib/Serialization/ASTReader.cpp +++ b/lib/Serialization/ASTReader.cpp @@ -538,7 +538,7 @@ IdentifierInfo *ASTIdentifierLookupTrait::ReadData(const internal_key_type& k, // Set or check the various bits in the IdentifierInfo structure. // Token IDs are read-only. - if (HasRevertedTokenIDToIdentifier) + if (HasRevertedTokenIDToIdentifier && II->getTokenID() != tok::identifier) II->RevertTokenIDToIdentifier(); II->setObjCOrBuiltinID(ObjCOrBuiltinID); assert(II->isExtensionToken() == ExtensionToken && diff --git a/test/Index/index-pch.cpp b/test/Index/index-pch.cpp index c8da7b2fbf..caab2d7f97 100644 --- a/test/Index/index-pch.cpp +++ b/test/Index/index-pch.cpp @@ -1,6 +1,8 @@ // RUN: c-index-test -write-pch %t.pch -fshort-wchar %s -// RUN: c-index-test -index-tu %t.pch | FileCheck %s +// RUN: env LIBCLANG_NOTHREADS=1 c-index-test -index-tu %t.pch | FileCheck %s +// CHECK: [indexDeclaration]: kind: variable | name: wideStr const wchar_t *wideStr = L"123"; -// CHECK: [indexDeclaration]: kind: variable | name: wideStr +// CHECK: [indexDeclaration]: kind: struct | name: __is_void +struct __is_void {}; |