[clang] [clang-repl] Allow private type aliases in out-of-line member function return types (PR #178842)

via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 29 23:51:44 PST 2026


fogsong233 wrote:

> Here you can find more information: #169272
> 
> The crux of the issue is that we recognize the out of line definition as a statement. We need to extend the logic as I've mentioned in the previous pull request, however, with the slight difference that we need to find out what is the exact parse interface that clang calls when actually parsing this. Since the other PR is generated by AI, I find it unlikely to be done by the author. Let's try to fix it here.

And now my change is to use SuppressAccessChecks. We need to check whether it's a statement or a declaration syntactically, not semantically. Therefore, access checks should be suppressed during this tentative phase.

Actually, I want to make isCXXDeclarationStatement fully tentative (reverting all side effects/annotations). This won't affect ParseFunctionDefinition, but since we are reverting everything, we need to adjust the logic in ParseTopLevelStmtDecl to handle the raw tokens (like ::) correctly when the tentative parse returns false.

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


More information about the cfe-commits mailing list