[clang] [Clang] prevent assertion in __has_embed parameter recovery at end-of-directive (PR #175104)

Corentin Jabot via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 9 04:28:12 PST 2026


================
@@ -3686,14 +3686,14 @@ Preprocessor::LexEmbedParameters(Token &CurTok, bool ForHasEmbed) {
           std::pair<tok::TokenKind, SourceLocation> Matches) {
         Diag(CurTok, diag::err_expected) << Expected;
         Diag(Matches.second, diag::note_matching) << Matches.first;
-        if (CurTok.isNot(EndTokenKind))
----------------
cor3ntin wrote:

Can't we just call `DiscardUntilEndOfDirective` unconditionally (ie remove the `if` line)?

https://github.com/llvm/llvm-project/pull/175104


More information about the cfe-commits mailing list