[PATCH] D50527: [Parser] Support alternative operator token keyword args in Objective-C++

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 9 13:00:09 PDT 2018


rsmith added a comment.

One comment, but otherwise the code change looks mechanically correct. Not accepting only because I don't know whether this is the intended language rule for Objective-C++ or not (please get someone else to sign off on that).



================
Comment at: clang/lib/Parse/ParseExpr.cpp:278
+  case tok::caretequal:
+    return isLetter(PP.getSpelling(Tok).front());
+  default:
----------------
Just check `Tok.getIdentifierInfo()`. That will be null for a punctuation token and non-null for a token spelled as an identifier. (I don't think you even need the `switch`, because we already only get here for operators.)


Repository:
  rC Clang

https://reviews.llvm.org/D50527





More information about the cfe-commits mailing list