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(); + if (RD->field_empty()) + RD = RD->getMostRecentDecl(); if (RD->getNumVBases()) { Info.FFDiag(CallLoc, diag::note_constexpr_virtual_base) << RD; return false;