зеркало из https://github.com/microsoft/clang-1.git
[PCH] Fix bug where we failed to update an identifier for a single token
macro expansion. rdar://10588825 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146818 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
71168330e2
Коммит
373cb78320
|
@ -116,6 +116,11 @@ static bool isTrivialSingleTokenExpansion(const MacroInfo *MI,
|
|||
// If the token isn't an identifier, it's always literally expanded.
|
||||
if (II == 0) return true;
|
||||
|
||||
// If the information about this identifier is out of date, update it from
|
||||
// the external source.
|
||||
if (II->isOutOfDate())
|
||||
PP.getExternalSource()->updateOutOfDateIdentifier(*II);
|
||||
|
||||
// If the identifier is a macro, and if that macro is enabled, it may be
|
||||
// expanded so it's not a trivial expansion.
|
||||
if (II->hasMacroDefinition() && PP.getMacroInfo(II)->isEnabled() &&
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
// rdar://10588825
|
||||
|
||||
// Test this without pch.
|
||||
// RUN: %clang_cc1 %s -include %s -verify -fsyntax-only
|
||||
|
||||
// Test with pch.
|
||||
// RUN: %clang_cc1 %s -emit-pch -o %t
|
||||
// RUN: %clang_cc1 %s -include-pch %t -verify -fsyntax-only
|
||||
|
||||
#ifndef HEADER
|
||||
#define HEADER
|
||||
|
||||
#define SKATA
|
||||
|
||||
#define __stdcall
|
||||
#define STDCALL __stdcall
|
||||
|
||||
void STDCALL Foo(void);
|
||||
|
||||
#else
|
||||
|
||||
void STDCALL Foo(void)
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
Загрузка…
Ссылка в новой задаче