[PATCH] D35172: Keep the IdentifierInfo in the Token for alternative operator keyword

Olivier Goffart via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 10 00:44:52 PDT 2017


ogoffart marked an inline comment as done.
ogoffart added inline comments.


================
Comment at: lib/Lex/PPExpressions.cpp:242
   switch (PeekTok.getKind()) {
-  default:  // Non-value token.
+  default:
+    // If this token's spelling is a pp-identifier, check to see if it is
----------------
rsmith wrote:
> I'm concerned that this will do the wrong thing for a keyword operator that is not permitted in a pp expression, like and_eq. It seems safer to revert this change and instead add a isCPlusPlusOperatorKeyword check to the "if" condition above.
Well spotted.  I kept this code in the default:  so true and false are handled separatly, but added a condition for isCPlusPlusOperatorKeyword, and an additional test.


https://reviews.llvm.org/D35172





More information about the cfe-commits mailing list