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

Shao-Ce SUN via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 24 03:12:46 PST 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rGa8b4b9104c8f: [NFC][clang] Simplify `isOneOf` function (authored by achieveartificialintelligence).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D117740/new/

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.411056.patch
Type: text/x-patch
Size: 621 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220224/b957657b/attachment.bin>


More information about the cfe-commits mailing list