[PATCH] D89946: [clang] Suppress "follow-up" diagnostics on recovery call expressions.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 26 01:42:08 PDT 2020


sammccall accepted this revision.
sammccall added a comment.
This revision is now accepted and ready to land.

Thanks! LG with comment nit



================
Comment at: clang/lib/Sema/SemaOverload.cpp:12808
+  // using RecoveryExpr.
+  return SemaRef.CreateRecoveryExpr(CallE.get()->getBeginLoc(),
+                                    CallE.get()->getEndLoc(), {CallE.get()});
----------------
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)


================
Comment at: clang/test/AST/ast-dump-recovery.cpp:277
+void TypoCorrection() {
+  // CHECK:      RecoveryExpr {{.*}} '<dependent type>'
+  // CHECK-NEXT: `-CallExpr {{.*}} 'void'
----------------
(so this could be void. It will still trigger some follow-on diagnostics though)


================
Comment at: clang/test/SemaCXX/typo-correction-delayed.cpp:216
+void test() {
+  // Verify the secondary diagnostic ".. convertiable to 'bool'" is suppressed.
+  if (abc()) {} // expected-error {{use of undeclared identifier 'abc'; did you mean 'abcc'?}}
----------------
nit: convertible


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