diff options
author | Sebastian Redl <sebastian.redl@getdesigned.at> | 2012-02-17 08:42:32 +0000 |
---|---|---|
committer | Sebastian Redl <sebastian.redl@getdesigned.at> | 2012-02-17 08:42:32 +0000 |
commit | 1f27805fe4f5463fd5b4d5396affe1ef23320688 (patch) | |
tree | 2e7ff6f06da1c0e2f183ef10d4bf3b01f0c65b03 /lib/Sema/SemaExprCXX.cpp | |
parent | 32cf1f27ae8620e7b79bb4e81a067187c0aab7ae (diff) |
Don't allow non-empty ParenListExprs as array-new initializers.
Don't know what I was thinking there. Fixes PR12023.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150804 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExprCXX.cpp')
-rw-r--r-- | lib/Sema/SemaExprCXX.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp index 1f50984996..ca8411918a 100644 --- a/lib/Sema/SemaExprCXX.cpp +++ b/lib/Sema/SemaExprCXX.cpp @@ -981,11 +981,8 @@ static bool isLegalArrayNewInitializer(CXXNewExpr::InitializationStyle Style, Expr *Init) { if (!Init) return true; - if (ParenListExpr *PLE = dyn_cast<ParenListExpr>(Init)) { - if (PLE->getNumExprs() != 1) - return PLE->getNumExprs() == 0; - Init = PLE->getExpr(0); - } + if (ParenListExpr *PLE = dyn_cast<ParenListExpr>(Init)) + return PLE->getNumExprs() == 0; if (isa<ImplicitValueInitExpr>(Init)) return true; else if (CXXConstructExpr *CCE = dyn_cast<CXXConstructExpr>(Init)) |