diff options
author | Alexey Samsonov <samsonov@google.com> | 2013-04-05 07:47:28 +0000 |
---|---|---|
committer | Alexey Samsonov <samsonov@google.com> | 2013-04-05 07:47:28 +0000 |
commit | 50f9de5d893694a7e46ba655ec9fce5dfeae9362 (patch) | |
tree | 4dd5939272714d80a8d1728b685a3899df323120 /lib/CodeGen/CGExprConstant.cpp | |
parent | 418780f132a6d790b248ef91e1067c3c3dd31350 (diff) |
Allow EmitConstantInit() to emit constant initializers for objects with trivial constructors and non-trivial destructors. Test that such objects are ignored by init-order checker.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178856 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprConstant.cpp')
-rw-r--r-- | lib/CodeGen/CGExprConstant.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/CodeGen/CGExprConstant.cpp b/lib/CodeGen/CGExprConstant.cpp index e3e5d66605..faaf6468f1 100644 --- a/lib/CodeGen/CGExprConstant.cpp +++ b/lib/CodeGen/CGExprConstant.cpp @@ -1018,8 +1018,7 @@ llvm::Constant *CodeGenModule::EmitConstantInit(const VarDecl &D, if (const CXXConstructExpr *E = dyn_cast_or_null<CXXConstructExpr>(D.getInit())) { const CXXConstructorDecl *CD = E->getConstructor(); - if (CD->isTrivial() && CD->isDefaultConstructor() && - Ty->getAsCXXRecordDecl()->hasTrivialDestructor()) + if (CD->isTrivial() && CD->isDefaultConstructor()) return EmitNullConstant(D.getType()); } } |