summaryrefslogtreecommitdiff
path: root/gcc/cp/call.c
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2015-03-09 19:59:54 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2015-03-09 19:59:54 +0000
commitf03a27dca05acf40a82ee5307448dde94b9b9555 (patch)
tree9419c41d55067980917ddff188920097354a69bc /gcc/cp/call.c
parent6054103a2e6ad55dee9e2d7a67097b8a8dcbfd90 (diff)
downloadgcc-f03a27dca05acf40a82ee5307448dde94b9b9555.tar.gz
PR c++/65339
* call.c: Don't call maybe_resolve_dummy when calling a constructor. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@221285 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/call.c')
-rw-r--r--gcc/cp/call.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 2b15185a895..fdd8436d53e 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -8020,7 +8020,11 @@ build_new_method_call_1 (tree instance, tree fns, vec<tree, va_gc> **args,
that would be captured if the call turns out to be to a
non-static member function. Do not actually capture it at this
point. */
- first_mem_arg = maybe_resolve_dummy (instance, false);
+ if (DECL_CONSTRUCTOR_P (fn))
+ /* Constructors don't use the enclosing 'this'. */
+ first_mem_arg = instance;
+ else
+ first_mem_arg = maybe_resolve_dummy (instance, false);
/* Get the high-water mark for the CONVERSION_OBSTACK. */
p = conversion_obstack_alloc (0);