[PATCH] D65591: [AST] Add a flag indicating if any subexpression had errors

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 18 09:47:23 PDT 2020


sammccall accepted this revision.
sammccall added inline comments.
This revision is now accepted and ready to land.


================
Comment at: clang/lib/AST/ComputeDependence.cpp:174
 ExprDependence clang::computeDependence(NoInitExpr *E) {
   return toExprDependence(E->getType()->getDependence()) &
          ExprDependence::Instantiation;
----------------
hokein wrote:
> sammccall wrote:
> > I'm not terribly sure of the implications of not propagating the error bit here. I tend to think that "contains errors" most closely follows instantiation-dependence (i.e. it's fairly strict/lexical), so I'd consider propagating it here.
> > 
> > BTW, DesignatedInitUpdateExpr seems to have totally broken dependence computations - it's always non-dependent! (Not introduced by this refactoring, I think). Any idea what's up there?
> you mean `DesignatedInitExpr`? I didn't see any problem there, why it is always non-dependent?
no, DesignatedInitUpdateExpr. There's no computeDependence function, it just marks itself as non-dependent in the constructor.


================
Comment at: clang/lib/AST/ComputeDependence.cpp:662
+    if (C)
+      D |= C->getDependence() & ExprDependence::Error;
+  }
----------------
rather than whitelisting the error bit, blacklist the UnexpandedPack bit?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D65591





More information about the cfe-commits mailing list