diff options
author | Jason Merrill <jason@redhat.com> | 2017-02-20 01:03:45 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2017-02-20 01:03:45 -0500 |
commit | b80dfe4441b689217cb3aefbc24c90d97b17d154 (patch) | |
tree | bb8ad8dc5e28b66ade3ca40bb77c84732fe7446c /gcc/cp | |
parent | c9688c535ead0299d55343f99b165e025321579f (diff) | |
download | gcc-b80dfe4441b689217cb3aefbc24c90d97b17d154.zip gcc-b80dfe4441b689217cb3aefbc24c90d97b17d154.tar.gz gcc-b80dfe4441b689217cb3aefbc24c90d97b17d154.tar.bz2 |
PR c++/79503 - inherited ctor taking base class
* call.c (add_function_candidate): Also check that
DECL_INHERITED_CTOR_BASE is reference-related to the parameter type.
From-SVN: r245586
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/call.c | 4 |
2 files changed, 9 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 20c7eed..9b071eb 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2017-02-19 Jason Merrill <jason@redhat.com> + + PR c++/79503 - inherited ctor taking base class + * call.c (add_function_candidate): Also check that + DECL_INHERITED_CTOR_BASE is reference-related to the parameter type. + 2017-02-19 Paolo Carlini <paolo.carlini@oracle.com> PR c++/79380 diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 4ef444b..d6d3a8f 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -2057,7 +2057,9 @@ add_function_candidate (struct z_candidate **candidates, { tree ptype = non_reference (TREE_VALUE (parmlist)); tree dtype = DECL_CONTEXT (fn); - if (reference_related_p (ptype, dtype)) + tree btype = DECL_INHERITED_CTOR_BASE (fn); + if (reference_related_p (ptype, dtype) + && reference_related_p (btype, ptype)) { viable = false; reason = inherited_ctor_rejection (); |