From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23653 invoked by alias); 24 Apr 2002 10:56:04 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 23611 invoked by uid 71); 24 Apr 2002 10:56:02 -0000 Date: Wed, 24 Apr 2002 03:56:00 -0000 Message-ID: <20020424105602.23606.qmail@sources.redhat.com> To: jason@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Jason Merrill Subject: Re: c++/6331: g++ 3.1 looses const qualifiers (C++ PATCH) Reply-To: Jason Merrill X-SW-Source: 2002-04/txt/msg01241.txt.bz2 List-Id: The following reply was made to PR c++/6331; it has been noted by GNATS. From: Jason Merrill To: Cc: gcc-patches@gcc.gnu.org, gcc-gnats@gcc.gnu.org Subject: Re: c++/6331: g++ 3.1 looses const qualifiers (C++ PATCH) Date: Wed, 24 Apr 2002 11:46:55 +0100 --=-=-= Here's a patch for the World.ii bug. We were winding up with a bogus version of 'const array of float' because we weren't consistently using the C++-specific build_qualified_type. Tested i686-pc-linux-gnu, applied trunk and 3.1. Test in g++.dg/init/array3.C. 2002-04-24 Jason Merrill PR c++/6331 * method.c (do_build_copy_constructor): Use cp_build_qualified_type. * typeck.c (build_modify_expr): Allow arrays to differ in cv-quals. --=-=-= Content-Type: text/x-patch Content-Disposition: inline *** method.c.~1~ Sat Apr 6 15:33:41 2002 --- method.c Wed Apr 24 09:54:22 2002 *************** do_build_copy_constructor (fndecl) *** 585,591 **** continue; init = build (COMPONENT_REF, ! build_qualified_type (TREE_TYPE (field), cvquals), init, field); init = build_tree_list (NULL_TREE, init); --- 585,591 ---- continue; init = build (COMPONENT_REF, ! cp_build_qualified_type (TREE_TYPE (field), cvquals), init, field); init = build_tree_list (NULL_TREE, init); *** typeck.c.~1~ Wed Apr 24 01:02:20 2002 --- typeck.c Wed Apr 24 09:56:28 2002 *************** build_modify_expr (lhs, modifycode, rhs) *** 5665,5674 **** { int from_array; ! if (!same_or_base_type_p (lhstype, TREE_TYPE (rhs))) { error ("incompatible types in assignment of `%T' to `%T'", ! TREE_TYPE (rhs), lhstype); return error_mark_node; } --- 5665,5675 ---- { int from_array; ! if (!same_or_base_type_p (TYPE_MAIN_VARIANT (lhstype), ! TYPE_MAIN_VARIANT (TREE_TYPE (rhs)))) { error ("incompatible types in assignment of `%T' to `%T'", ! TREE_TYPE (rhs), lhstype); return error_mark_node; } --=-=-=--