diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2023-07-19 09:18:50 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2023-07-19 17:14:23 +0000 |
commit | 8d0cab8800e19cddc56d4a532abdbe9f0ac6c620 (patch) | |
tree | e7121348f0bac171713e2d0b126da4d43db345a3 | |
parent | 66fd12cf4896eb08ad8e7a2627537f84ead84dd3 (diff) |
-rw-r--r-- | contrib/llvm-project/clang/lib/AST/ComputeDependence.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/contrib/llvm-project/clang/lib/AST/ComputeDependence.cpp b/contrib/llvm-project/clang/lib/AST/ComputeDependence.cpp index eb9afbdb1c87..b5c783b07d92 100644 --- a/contrib/llvm-project/clang/lib/AST/ComputeDependence.cpp +++ b/contrib/llvm-project/clang/lib/AST/ComputeDependence.cpp @@ -489,7 +489,7 @@ ExprDependence clang::computeDependence(DeclRefExpr *E, const ASTContext &Ctx) { // more bullets here that we handle by treating the declaration as having a // dependent type if they involve a placeholder type that can't be deduced.] if (Type->isDependentType()) - return Deps | ExprDependence::TypeValueInstantiation; + Deps |= ExprDependence::TypeValueInstantiation; else if (Type->isInstantiationDependentType()) Deps |= ExprDependence::Instantiation; @@ -525,13 +525,13 @@ ExprDependence clang::computeDependence(DeclRefExpr *E, const ASTContext &Ctx) { // - it names a potentially-constant variable that is initialized with an // expression that is value-dependent if (const auto *Var = dyn_cast<VarDecl>(Decl)) { - if (Var->mightBeUsableInConstantExpressions(Ctx)) { - if (const Expr *Init = Var->getAnyInitializer()) { - if (Init->isValueDependent()) - Deps |= ExprDependence::ValueInstantiation; - if (Init->containsErrors()) - Deps |= ExprDependence::Error; - } + if (const Expr *Init = Var->getAnyInitializer()) { + if (Init->containsErrors()) + Deps |= ExprDependence::Error; + + if (Var->mightBeUsableInConstantExpressions(Ctx) && + Init->isValueDependent()) + Deps |= ExprDependence::ValueInstantiation; } // - it names a static data member that is a dependent member of the |