aboutsummaryrefslogtreecommitdiff
path: root/lib/Lex/Preprocessor.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2010-09-03 01:26:16 +0000
committerFariborz Jahanian <fjahanian@apple.com>2010-09-03 01:26:16 +0000
commitbe74740cc246ce08d42804a684385a42eb814edb (patch)
tree1fda5a03d04b57d582ef7a9f2f5efcfcbfae964d /lib/Lex/Preprocessor.cpp
parent4938f2385f82e54df019b2fb1128a58ebad98bec (diff)
Patch to allow alternative representation of c++
operators (and, or, etc.) to be used as selectors to match g++'s behavior. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112935 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/Preprocessor.cpp')
-rw-r--r--lib/Lex/Preprocessor.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Lex/Preprocessor.cpp b/lib/Lex/Preprocessor.cpp
index 5160acf19e..05621d31b3 100644
--- a/lib/Lex/Preprocessor.cpp
+++ b/lib/Lex/Preprocessor.cpp
@@ -613,8 +613,10 @@ void Preprocessor::HandleIdentifier(Token &Identifier) {
// C++ 2.11p2: If this is an alternative representation of a C++ operator,
// then we act as if it is the actual operator and not the textual
// representation of it.
- if (II.isCPlusPlusOperatorKeyword())
+ if (II.isCPlusPlusOperatorKeyword()) {
Identifier.setIdentifierInfo(0);
+ Identifier.setFlag(Token::CPlusPlusOpKeyword);
+ }
// If this is an extension token, diagnose its use.
// We avoid diagnosing tokens that originate from macro definitions.