[all-commits] [llvm/llvm-project] f6f050: [clang-repl] Fix disambiguation of out-of-line mem...
fogsong233 via All-commits
all-commits at lists.llvm.org
Thu Feb 12 01:24:11 PST 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: f6f0503673b746a2e43a995006ced39c5c7e412e
https://github.com/llvm/llvm-project/commit/f6f0503673b746a2e43a995006ced39c5c7e412e
Author: fogsong233 <fogsong233 at gmail.com>
Date: 2026-02-12 (Thu, 12 Feb 2026)
Changed paths:
M clang/lib/Parse/ParseTentative.cpp
A clang/test/Interpreter/access.cpp
M clang/test/Interpreter/disambiguate-decl-stmt.cpp
Log Message:
-----------
[clang-repl] Fix disambiguation of out-of-line member with private types (#178842)
This patch fixes a bug in clang-repl where out-of-line member function
definitions were incorrectly identified as statements when they involved
private type aliases.
The issue occurred because `isCXXDeclarationStatement` would trigger
immediate access checks during tentative parsing. Since the context of
an out-of-line definition isn't fully established during this phase,
Sema would incorrectly flag private members as inaccessible, causing
the parser to fail the declaration check and fall back to statement
parsing.
Changes:
- In `isCXXDeclarationStatement`, use `TentativeParsingAction` to
ensure the token stream is fully restored.
- Use `SuppressAccessChecks` during the tentative disambiguation phase
to prevent premature access errors.
- Ensure that formal access verification still occurs during the
actual parsing phase in `ParseDeclarationOrFunctionDefinition`.
- Add tests and resolve a FIXME in
clang/test/Interpreter/disambiguate-decl-stmt.cpp.
Fixes llvm#164885.
See also jank-lang/jank#609.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list