[clang] [clang][Parser] Fix an assertion during decltype error recovery with missing ; (PR #188123)

Haojian Wu via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 31 06:37:03 PDT 2026


hokein wrote:

Back to the current fix: the preprocessor cache remains correctly updated (the `Pos`) and the text buffer stays aligned with the written source code (I think this is by designed).

The issue is because this specific recovery path manually sets the current Token to `;` regardless of the actual source content. The assertion fails because it expects the token stream to match this synthetic parser state. Given that, removing the assertion seems reasonable to me.

I am less certain about modifying the preprocessor state to match the parser state, that feels like a much riskier change.

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


More information about the cfe-commits mailing list