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
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))
}
}
+
+namespace P12023 {
+ struct CopyCounter
+ {
+ CopyCounter();
+ CopyCounter(const CopyCounter&);
+ };
+
+ int main()
+ {
+ CopyCounter* f = new CopyCounter[10](CopyCounter()); // expected-error {{cannot have initialization arguments}}
+ return 0;
+ }
+}