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 | eb54f08aee50a2fe2c2a7d16fe28d620c791a1ca (patch) | |
tree | b92ec5149e131cb5b4056e222ea51ff26255c740 /clang/lib/Sema/SemaExprCXX.cpp | |
parent | c83ed8248e6cb010b132ed541d8e19ab70acbb2d (diff) | |
download | bcm5719-llvm-eb54f08aee50a2fe2c2a7d16fe28d620c791a1ca.tar.gz bcm5719-llvm-eb54f08aee50a2fe2c2a7d16fe28d620c791a1ca.zip |
Don't allow non-empty ParenListExprs as array-new initializers.
Don't know what I was thinking there. Fixes PR12023.
llvm-svn: 150804
Diffstat (limited to 'clang/lib/Sema/SemaExprCXX.cpp')
-rw-r--r-- | clang/lib/Sema/SemaExprCXX.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp index 1f50984996a..ca8411918a7 100644 --- a/clang/lib/Sema/SemaExprCXX.cpp +++ b/clang/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)) |