public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: Jason Merrill <jason@redhat.com> To: jason@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, Subject: Re: c++/6392: [PATCH] Problems with __restrict__ type qualifier (array) Date: Fri, 03 May 2002 09:26:00 -0000 [thread overview] Message-ID: <20020503162601.10110.qmail@sources.redhat.com> (raw) 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; } --=-=-=--
reply other threads:[~2002-05-03 16:26 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20020503162601.10110.qmail@sources.redhat.com \ --to=jason@redhat.com \ --cc=gcc-prs@gcc.gnu.org \ --cc=jason@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).