public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/6392: [PATCH] Problems with __restrict__ type qualifier (array)
@ 2002-05-03 9:26 Jason Merrill
0 siblings, 0 replies; only message in thread
From: Jason Merrill @ 2002-05-03 9:26 UTC (permalink / raw)
To: jason; +Cc: gcc-prs
The following reply was made to PR c++/6392; it has been noted by GNATS.
From: Jason Merrill <jason@redhat.com>
To: gcc-bugs@gcc.gnu.org, Daniel Berlin <dberlin@dberlin.org>
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 <jason@redhat.com>
* 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;
}
--=-=-=--
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2002-05-03 16:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-03 9:26 c++/6392: [PATCH] Problems with __restrict__ type qualifier (array) Jason Merrill
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).