[PATCH] D117740: [NFC][clang] Simplify `isOneOf` function

Shao-Ce SUN via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 19 18:59:30 PST 2022


achieveartificialintelligence created this revision.
achieveartificialintelligence added reviewers: alexfh, danielmarjamaki.
achieveartificialintelligence requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D117740

Files:
  clang/include/clang/Lex/Token.h


Index: clang/include/clang/Lex/Token.h
===================================================================
--- clang/include/clang/Lex/Token.h
+++ clang/include/clang/Lex/Token.h
@@ -99,9 +99,8 @@
   bool isOneOf(tok::TokenKind K1, tok::TokenKind K2) const {
     return is(K1) || is(K2);
   }
-  template <typename... Ts>
-  bool isOneOf(tok::TokenKind K1, tok::TokenKind K2, Ts... Ks) const {
-    return is(K1) || isOneOf(K2, Ks...);
+  template <typename... Ts> bool isOneOf(tok::TokenKind K1, Ts... Ks) const {
+    return is(K1) || isOneOf(Ks...);
   }
 
   /// Return true if this is a raw identifier (when lexing


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D117740.401479.patch
Type: text/x-patch
Size: 621 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220120/c388c19f/attachment.bin>


More information about the cfe-commits mailing list