[clang] [NFC][Clang][Preprocessor] Refine the implementation of isNextPPTokenOneOf (PR #145546)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Jun 24 09:59:40 PDT 2025
================
@@ -2304,7 +2304,8 @@ class Preprocessor {
/// Check whether the next pp-token is one of the specificed token kind. this
/// method should have no observable side-effect on the lexed tokens.
- template <tok::TokenKind K, tok::TokenKind... Ks> bool isNextPPTokenOneOf() {
+ template <typename... Ts>
+ bool isNextPPTokenOneOf(tok::TokenKind K, Ts... Ks) {
----------------
yronglin wrote:
Yes, I think `bool isNextPPTokenOneOf(Ts... Ks) with static_assert(sizeof...(Ks))` is equal to `bool isNextPPTokenOneOf(tok::TokenKind K, Ts... Ks)`. But static_assert may give a more clear diagnostic. WDYT?
https://github.com/llvm/llvm-project/pull/145546
More information about the cfe-commits
mailing list