to support operator keywords used in Windows SDK, alter token type when seen in system headers Hello, I submitted D33505 to address this problem, but the proposal was rejected as too big a hammer. This change will allow clang to parse the WindowsSDK header <query.h> which uses the operator name "or" as a field name. Treat cpp operator keywords as ordinary identifiers inside the Microsoft headers, but treat them as usual in the user's program. Original Submitter: Melanie Blower (mibintc) Differential Revision: https://reviews.llvm.org/D33782 llvm-svn: 305087
12 lines
366 B
C++
12 lines
366 B
C++
// RUN: %clang_cc1 -triple x86_64-pc-win32 -fms-compatibility \
|
|
// RUN: -ffreestanding -fsyntax-only -Werror %s -verify
|
|
// RUN: %clang_cc1 \
|
|
// RUN: -ffreestanding -fsyntax-only -Werror %s -verify
|
|
// expected-no-diagnostics
|
|
int bb ( int x)
|
|
{
|
|
// In user code, treat operator keyword as operator keyword.
|
|
if ( x>1 or x<0) return 1;
|
|
else return 0;
|
|
}
|