[PATCH] D120812: [AST] Use RecoveryExpr to model a DeclRefExpr which refers to an invalid Decl.
Haojian Wu via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Mar 3 01:32:56 PST 2022
hokein added a comment.
In D120812#3354308 <https://reviews.llvm.org/D120812#3354308>, @sammccall wrote:
> Very nice! I thought we had considered and rejected this in the past, but I think it was rather allowing lookup to find invalid decls in cases where it doesn't today.
Yeah, in the past (https://reviews.llvm.org/D76831), we tried to build the `DeclRefExpr` even for an invalid ref decl, it made the diagnostics much worse (as we don't know the type of the invalid decl, the fallback int type is not suitable for every cases).
We use a different approach in this approach (build RecoveryExpr instead), a sad bit is that we are not able to retrieve the ref decl from the `RecoveryExpr`.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D120812/new/
https://reviews.llvm.org/D120812
More information about the cfe-commits
mailing list