summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGClass.cpp
diff options
context:
space:
mode:
authorReid Kleckner <reid@kleckner.net>2014-01-13 22:57:31 +0000
committerReid Kleckner <reid@kleckner.net>2014-01-13 22:57:31 +0000
commit340ad862d9ae893c6443ef68b6b48ff77a171910 (patch)
tree7080f676ca078a5497b0982fe034306666faf870 /clang/lib/CodeGen/CGClass.cpp
parent69c26e903b254540bd3b438321e8194459359e68 (diff)
downloadbcm5719-llvm-340ad862d9ae893c6443ef68b6b48ff77a171910.tar.gz
bcm5719-llvm-340ad862d9ae893c6443ef68b6b48ff77a171910.zip
[ms-abi] Always generate complete constructors in the Microsoft C++ ABI
Fixes PR18435, where we generated a base ctor instead of a complete ctor, and so failed to construct virtual bases when constructing the complete object. llvm-svn: 199160
Diffstat (limited to 'clang/lib/CodeGen/CGClass.cpp')
-rw-r--r--clang/lib/CodeGen/CGClass.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGClass.cpp b/clang/lib/CodeGen/CGClass.cpp
index 701a7d341d1..8143fb9ca5d 100644
--- a/clang/lib/CodeGen/CGClass.cpp
+++ b/clang/lib/CodeGen/CGClass.cpp
@@ -699,6 +699,10 @@ void CodeGenFunction::EmitConstructorBody(FunctionArgList &Args) {
const CXXConstructorDecl *Ctor = cast<CXXConstructorDecl>(CurGD.getDecl());
CXXCtorType CtorType = CurGD.getCtorType();
+ assert((CGM.getTarget().getCXXABI().hasConstructorVariants() ||
+ CtorType == Ctor_Complete) &&
+ "can only generate complete ctor for this ABI");
+
// Before we go any further, try the complete->base constructor
// delegation optimization.
if (CtorType == Ctor_Complete && IsConstructorDelegationValid(Ctor) &&
OpenPOWER on IntegriCloud