From ad2320c4eccc00870a485d873432bd7cbddbfa37 Mon Sep 17 00:00:00 2001 From: nathan Date: Tue, 9 Mar 2004 18:44:02 +0000 Subject: cp: PR c++/14397 * call.c (convert_like_real): Build a const qualified temporary, when testing ctor access. testsuite: PR c++/14397 * g++.dg/overload/ref1.C: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@79196 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cp/ChangeLog | 6 ++++++ gcc/cp/call.c | 7 ++++--- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'gcc/cp') diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index eefa1e76dbc..a0d2b067492 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2004-03-09 Nathan Sidwell + + PR c++/14397 + * call.c (convert_like_real): Build a const qualified temporary, + when testing ctor access. + 2004-03-09 Mark Mitchell * call.c (initialize_reference): Fix typo. diff --git a/gcc/cp/call.c b/gcc/cp/call.c index b43efcdae3f..320159ba9e7 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -4209,9 +4209,10 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum, if (convs->check_copy_constructor_p) /* Generate a temporary copy purely to generate the required diagnostics. */ - build_temp (build_dummy_object (totype), totype, - LOOKUP_NORMAL|LOOKUP_ONLYCONVERTING, - &diagnostic_fn); + build_temp + (build_dummy_object + (build_qualified_type (totype, TYPE_QUAL_CONST)), + totype, LOOKUP_NORMAL|LOOKUP_ONLYCONVERTING, &diagnostic_fn); return expr; case ck_ambig: /* Call build_user_type_conversion again for the error. */ -- cgit v1.2.1