aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/ExprConstant.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/AST/ExprConstant.cpp')
-rw-r--r--lib/AST/ExprConstant.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp
index 1a396e1425..0ef7111f97 100644
--- a/lib/AST/ExprConstant.cpp
+++ b/lib/AST/ExprConstant.cpp
@@ -3387,6 +3387,11 @@ bool RecordExprEvaluator::ZeroInitialization(const Expr *E) {
return EvaluateInPlace(Result.getUnionValue(), Info, Subobject, &VIE);
}
+ if (isa<CXXRecordDecl>(RD) && cast<CXXRecordDecl>(RD)->getNumVBases()) {
+ Info.Diag(E->getExprLoc(), diag::note_constexpr_virtual_base) << RD;
+ return false;
+ }
+
return HandleClassZeroInitialization(Info, E, RD, This, Result);
}