[PATCH] D78100: [AST] Suppress the spammy "attempt to use a deleted fucntion" diagnostic.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 20 09:10:35 PDT 2020


sammccall added a comment.

OK LG without changes



================
Comment at: clang/lib/Sema/SemaDecl.cpp:12565
+      auto RecoveryExpr =
+          CreateRecoveryExpr(Var->getLocation(), Var->getEndLoc(), {});
+      if (RecoveryExpr.get())
----------------
hokein wrote:
> sammccall wrote:
> > This seems like it's going to claim some actual tokens, when the thing it represents doesn't cover any tokens.
> > 
> > I think both start/end source locations should be invalid.
> actually, I think it is still valuable to set the var location to recovery-expr.
> ```
> Foo [[foo]]; // if there is a valid default ctor, we have a CtorExpr which has the `foo` range; otherwise there is a recoveryExpr with the same range.
> ```
Yeah, invalid source range is scary too. Let's go with this and see if things break. I think more likely it'll be a mild annoyance like the range of CXXConstructExpr.

(In a perfect world maybe this would have a location but no range, or a SourceRange would have half-open semantics and could represent a point).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78100/new/

https://reviews.llvm.org/D78100





More information about the cfe-commits mailing list