aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Sema/SemaExprCXX.cpp2
-rw-r--r--test/SemaCXX/new-delete.cpp3
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp
index 73cc0513f0..a44dcf6f8b 100644
--- a/lib/Sema/SemaExprCXX.cpp
+++ b/lib/Sema/SemaExprCXX.cpp
@@ -550,7 +550,7 @@ bool Sema::FindAllocationOverload(SourceLocation StartLoc, SourceRange Range,
// asserted on, though, since invalid decls are left in there.)
for (unsigned i = 1; i < NumArgs; ++i) {
// FIXME: Passing word to diagnostic.
- if (PerformCopyInitialization(Args[i-1],
+ if (PerformCopyInitialization(Args[i],
FnDecl->getParamDecl(i)->getType(),
"passing"))
return true;
diff --git a/test/SemaCXX/new-delete.cpp b/test/SemaCXX/new-delete.cpp
index 2f763e0f78..f890bf56e3 100644
--- a/test/SemaCXX/new-delete.cpp
+++ b/test/SemaCXX/new-delete.cpp
@@ -21,6 +21,7 @@ struct V : U
void* operator new(size_t); // expected-note 2 {{candidate}}
void* operator new(size_t, int*); // expected-note 3 {{candidate}}
void* operator new(size_t, float*); // expected-note 3 {{candidate}}
+void* operator new(size_t, S); // expected-note 2 {{candidate}}
void good_news()
{
@@ -39,6 +40,8 @@ void good_news()
U *pu = new (ps) U;
// FIXME: Inherited functions are not looked up currently.
//V *pv = new (ps) V;
+
+ pi = new (S(1.0f, 2)) int;
}
struct abstract {