[PATCH] D142143: [Lex] For dependency directive lexing, angled includes in `__has_include` should be lexed as string literals

Argyrios Kyrtzidis via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 19 12:06:24 PST 2023


akyrtzi added inline comments.


================
Comment at: clang/lib/Lex/Lexer.cpp:4420
+          DepDirectives.front().Tokens[NextDepDirectiveTokenIndex];
+      if (BufferStart + NextTok.Offset >= BufferPtr)
+        break;
----------------
benlangmuir wrote:
> How do we know this will terminate?
If `LexAngledStringLiteral()` returns `tok::header_name` there were valid tokens that formed a header include and it has set `BufferPtr` after the `>` token. I can't think of reason it would not terminate.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D142143



More information about the cfe-commits mailing list