rsmith requested changes to this revision. rsmith added a comment. This revision now requires changes to proceed.
I think the assertion is correct: if we reach this point, then we have a `DeclRefExpr` that is not value-dependent and refers to a declaration whose initializer is value-dependent. That should never happen if the variable's type satisfies the requirements for use in a constant expression, which is what `mightBeUsableInConstantExpressions` checks. The bug here appears to be that the dependency bits on a `DeclRefExpr` are computed too early when it refers to a templated variable -- before we instantiate the initializer -- and don't get "fixed" later when the initializer is instantiated. `DoMarkVarDeclReferenced` would be the right place to handle this -- after we trigger instantiation of the initializer, we should recompute the dependence bits on the `DeclRefExpr`, because they can depend on the initializer. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D86649/new/ https://reviews.llvm.org/D86649 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits