aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExprAgg.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/CGExprAgg.cpp')
-rw-r--r--lib/CodeGen/CGExprAgg.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/CGExprAgg.cpp b/lib/CodeGen/CGExprAgg.cpp
index 457e44d086..8747562ce5 100644
--- a/lib/CodeGen/CGExprAgg.cpp
+++ b/lib/CodeGen/CGExprAgg.cpp
@@ -624,7 +624,8 @@ void AggExprEmitter::VisitInitListExpr(InitListExpr *E) {
bool hasNonTrivialCXXConstructor = false;
if (CGF.getContext().getLangOptions().CPlusPlus)
- if (const RecordType *RT = ElementType->getAs<RecordType>()) {
+ if (const RecordType *RT = CGF.getContext()
+ .getBaseElementType(ElementType)->getAs<RecordType>()) {
const CXXRecordDecl *RD = cast<CXXRecordDecl>(RT->getDecl());
hasNonTrivialCXXConstructor = !RD->hasTrivialConstructor();
}