================
@@ -2383,6 +2384,59 @@ class Preprocessor {
   /// token.
   std::optional<Token> peekNextPPToken() const;
 
+  /// Check whether the next preprocessing token can form a header-name token
+  /// or matches one of the specified token kinds.
+  ///
+  /// This performs a lookahead without consuming tokens:
+  ///  - First, it temporarily enables `ParsingFilename` to attempt forming a
+  ///    `tok::header_name` (e.g. `<foo>` or "foo").
+  ///  - If that succeeds, returns true.
+  ///  - Otherwise, it restores normal lexing mode and checks whether the next
+  ///    token matches any of the provided kinds `Ks...`.
+  ///
+  /// This helper is used to classify tokens in contexts such as C++20 `import`
+  /// and `#include`, ensuring consistent handling of header-name lexing and
+  /// avoiding unintended lexer state changes.
+  template <typename... Ts> bool isNextPPTokenHeaderNameOrOneOf(Ts... Ks) {
----------------
yronglin wrote:

I have removed this function.

https://github.com/llvm/llvm-project/pull/191004
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to