diff options
Diffstat (limited to 'clang/lib/Sema/SemaDeclCXX.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaDeclCXX.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp index d21d2689123..eaeca7806d4 100644 --- a/clang/lib/Sema/SemaDeclCXX.cpp +++ b/clang/lib/Sema/SemaDeclCXX.cpp @@ -13401,7 +13401,8 @@ void Sema::FinalizeVarWithDestructor(VarDecl *VD, const RecordType *Record) { // If the destructor is constexpr, check whether the variable has constant // destruction now. - if (Destructor->isConstexpr() && VD->evaluateValue()) { + if (Destructor->isConstexpr() && VD->getInit() && + !VD->getInit()->isValueDependent() && VD->evaluateValue()) { SmallVector<PartialDiagnosticAt, 8> Notes; if (!VD->evaluateDestruction(Notes) && VD->isConstexpr()) { Diag(VD->getLocation(), |

