diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp --- a/clang/lib/AST/ExprConstant.cpp +++ b/clang/lib/AST/ExprConstant.cpp @@ -6229,6 +6229,8 @@ return false; const CXXRecordDecl *RD = Definition->getParent(); + assert(RD->hasDefinition() && "Definition is needed to read the fields"); + RD = RD->getDefinition(); if (RD->getNumVBases()) { Info.FFDiag(CallLoc, diag::note_constexpr_virtual_base) << RD; return false;