[PATCH] D89946: [clang] Suppress "follow-up" diagnostics on recovery call expressions.
Haojian Wu via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Oct 26 02:24:58 PDT 2020
hokein added inline comments.
================
Comment at: clang/lib/Sema/SemaOverload.cpp:12808
+ // using RecoveryExpr.
+ return SemaRef.CreateRecoveryExpr(CallE.get()->getBeginLoc(),
+ CallE.get()->getEndLoc(), {CallE.get()});
----------------
sammccall wrote:
> is it a deliberate decision to drop the return type of the recovery function here too? If so, mention it in the comment (currentyl you only talk about not preserving the real call node)
yes, we deliberately use a dependent-type for recovery-expr to suppress diagnostics (rely on clang's dependent mechanism).
================
Comment at: clang/test/AST/ast-dump-recovery.cpp:277
+void TypoCorrection() {
+ // CHECK: RecoveryExpr {{.*}} '<dependent type>'
+ // CHECK-NEXT: `-CallExpr {{.*}} 'void'
----------------
sammccall wrote:
> (so this could be void. It will still trigger some follow-on diagnostics though)
As described in the previous comment, the type should always be dependent.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D89946/new/
https://reviews.llvm.org/D89946
More information about the cfe-commits
mailing list