diff options
-rw-r--r-- | lib/Sema/SemaOverload.cpp | 4 | ||||
-rw-r--r-- | test/SemaCXX/overload-call.cpp | 15 |
2 files changed, 17 insertions, 2 deletions
diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp index cfc8068b96..40d48e3cc6 100644 --- a/lib/Sema/SemaOverload.cpp +++ b/lib/Sema/SemaOverload.cpp @@ -6293,7 +6293,7 @@ Sema::BuildCallToObjectOfClassType(Scope *S, Expr *Object, return ActOnCallExpr(S, ExprArg(*this, CE), LParenLoc, MultiExprArg(*this, (ExprTy**)Args, NumArgs), - CommaLocs, RParenLoc).release(); + CommaLocs, RParenLoc).result(); } CheckMemberOperatorAccess(LParenLoc, Object, 0, Best->FoundDecl); @@ -6397,7 +6397,7 @@ Sema::BuildCallToObjectOfClassType(Scope *S, Expr *Object, if (CheckFunctionCall(Method, TheCall.get())) return true; - return MaybeBindToTemporary(TheCall.release()).release(); + return MaybeBindToTemporary(TheCall.release()).result(); } /// BuildOverloadedArrowExpr - Build a call to an overloaded @c operator-> diff --git a/test/SemaCXX/overload-call.cpp b/test/SemaCXX/overload-call.cpp index c286028c29..f3a5fba8e6 100644 --- a/test/SemaCXX/overload-call.cpp +++ b/test/SemaCXX/overload-call.cpp @@ -406,3 +406,18 @@ namespace PR6483 { f1(x1); // expected-error{{no matching function for call}} } } + +namespace PR6078 { + struct A { // expected-note{{candidate is the implicit copy constructor}} + A(short); // expected-note{{candidate constructor}} + A(long); // expected-note{{candidate constructor}} + }; + struct S { + typedef void ft(A); + operator ft*(); + }; + + void f() { + S()(0); // expected-error{{conversion from 'int' to 'PR6078::A' is ambiguous}} + } +} |