From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10147 invoked by alias); 3 May 2002 16:26:02 -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 10111 invoked by uid 71); 3 May 2002 16:26:01 -0000 Date: Fri, 03 May 2002 09:26:00 -0000 Message-ID: <20020503162601.10110.qmail@sources.redhat.com> To: jason@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Jason Merrill Subject: Re: c++/6392: [PATCH] Problems with __restrict__ type qualifier (array) Reply-To: Jason Merrill X-SW-Source: 2002-05/txt/msg00072.txt.bz2 List-Id: The following reply was made to PR c++/6392; it has been noted by GNATS. From: Jason Merrill To: gcc-bugs@gcc.gnu.org, Daniel Berlin Cc: schmid@snake.iap.physik.tu-darmstadt.de, gcc-gnats@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: Re: c++/6392: [PATCH] Problems with __restrict__ type qualifier (array) Date: Fri, 03 May 2002 17:21:16 +0100 --=-=-= This seems like the right fix; there's no reason to apply the bizarre array cv-qual handling to restrict. Tested i686-pc-linux-gnu, applied trunk only. I put Daniel's test in g++.dg/template/restrict1.C. 2002-05-03 Jason Merrill * tree.c (build_cplus_array_type): Only const and volatile get special handling. --=-=-= Content-Type: text/x-patch Content-Disposition: inline *** tree.c.~1~ Fri May 3 13:15:44 2002 --- tree.c Thu May 2 17:01:44 2002 *************** build_cplus_array_type (elt_type, index_ *** 495,508 **** { tree t; int type_quals = cp_type_quals (elt_type); ! if (type_quals != TYPE_UNQUALIFIED) ! elt_type = cp_build_qualified_type (elt_type, TYPE_UNQUALIFIED); t = build_cplus_array_type_1 (elt_type, index_type); ! if (type_quals != TYPE_UNQUALIFIED) ! t = cp_build_qualified_type (t, type_quals); return t; } --- 495,510 ---- { tree t; int type_quals = cp_type_quals (elt_type); + int cv_quals = type_quals & (TYPE_QUAL_CONST|TYPE_QUAL_VOLATILE); + int other_quals = type_quals & ~(TYPE_QUAL_CONST|TYPE_QUAL_VOLATILE); ! if (cv_quals) ! elt_type = cp_build_qualified_type (elt_type, other_quals); t = build_cplus_array_type_1 (elt_type, index_type); ! if (cv_quals) ! t = cp_build_qualified_type (t, cv_quals); return t; } --=-=-=--