summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ExprCXX.cpp
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2011-11-27 22:09:28 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2011-11-27 22:09:28 +0000
commitfbef4c8657518dfb14da794bbdd86bd2fd610cbc (patch)
tree527da7a6a5d1b413f86bcf3eed42b067c66cf4a3 /clang/lib/AST/ExprCXX.cpp
parent702b2841a4d26f78ccdeb116fe2b9b9590684990 (diff)
downloadbcm5719-llvm-fbef4c8657518dfb14da794bbdd86bd2fd610cbc.tar.gz
bcm5719-llvm-fbef4c8657518dfb14da794bbdd86bd2fd610cbc.zip
In Sema::MaybeBindToTemporary, create a CXXBindTemporaryExpr for an
array of objects with non-trivial destructors. PR11365. llvm-svn: 145203
Diffstat (limited to 'clang/lib/AST/ExprCXX.cpp')
-rw-r--r--clang/lib/AST/ExprCXX.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/AST/ExprCXX.cpp b/clang/lib/AST/ExprCXX.cpp
index 99e9002a482..1bbf8494fa2 100644
--- a/clang/lib/AST/ExprCXX.cpp
+++ b/clang/lib/AST/ExprCXX.cpp
@@ -618,8 +618,9 @@ CXXTemporary *CXXTemporary::Create(ASTContext &C,
CXXBindTemporaryExpr *CXXBindTemporaryExpr::Create(ASTContext &C,
CXXTemporary *Temp,
Expr* SubExpr) {
- assert(SubExpr->getType()->isRecordType() &&
- "Expression bound to a temporary must have record type!");
+ assert((SubExpr->getType()->isRecordType() ||
+ SubExpr->getType()->isArrayType()) &&
+ "Expression bound to a temporary must have record or array type!");
return new (C) CXXBindTemporaryExpr(Temp, SubExpr);
}
OpenPOWER on IntegriCloud