[PATCH] D154861: [clang][AST] Propagate the contains-errors bit to DeclRefExpr from VarDecl's initializer.

Shafik Yaghmour via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 10 15:27:03 PDT 2023


shafik added inline comments.


================
Comment at: clang/lib/AST/ComputeDependence.cpp:461
 /// based on the declaration being referenced.
 ExprDependence clang::computeDependence(DeclRefExpr *E, const ASTContext &Ctx) {
   auto Deps = ExprDependence::None;
----------------
`computeDependence` does not feel particularly well organized, it is not clear to me how correct it is :-(


================
Comment at: clang/lib/AST/ComputeDependence.cpp:532
+
     if (Var->mightBeUsableInConstantExpressions(Ctx)) {
       if (const Expr *Init = Var->getAnyInitializer()) {
----------------
It feels like we could fold this under the `if (const Expr *Init = Var->getAnyInitializer(); Init ` above and not duplicate code. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D154861



More information about the cfe-commits mailing list