[clang] [clang][Parser] Improve error recovery for missing semicolons in class members. (PR #190744)
Haojian Wu via cfe-commits
cfe-commits at lists.llvm.org
Sat Apr 11 14:15:03 PDT 2026
================
@@ -194,6 +194,17 @@ bool Parser::ExpectAndConsumeSemi(unsigned DiagID, StringRef TokenUsed) {
return ExpectAndConsume(tok::semi, DiagID , TokenUsed);
}
+bool Parser::TryInjectSemicolon() {
+ if (Tok.isAtStartOfLine() &&
+ (isDeclarationSpecifier(ImplicitTypenameContext::No))) {
----------------
hokein wrote:
I wanted to avoid duplicating this check in multiple places.
And I realized that the token injection was unnecessary after all, so I have simplified this method to just perform the check without modifying the token stream.
https://github.com/llvm/llvm-project/pull/190744
More information about the cfe-commits
mailing list