public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "bangerth at dealii dot org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/2892] array addresses corrupted when using template classes Date: Wed, 28 Apr 2004 07:44:00 -0000 [thread overview] Message-ID: <20040428064811.1309.qmail@sources.redhat.com> (raw) In-Reply-To: <20010521155602.2892.goyette@sgi.com> ------- Additional Comments From bangerth at dealii dot org 2004-04-28 06:48 ------- That is actually a pretty good point -- the function that fails is the only one where the type of the argument is not deducted but explicitly specified as a template argument, namely int[2]. It would seem to be that it is indeed passed by value, which is what the compiler warns about. Running the program subsequently fails. In all the other cases, the deduced type for the argument should be a reference, and taking the address should and does yield the correct result. Likewise, if I change the argument of the failing function to take a reference F&, then the program succeeds. Nathan, what do you think? Was this just as oversight, or am I missing something? I believe that Andrew is actually right here. W. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=2892
next prev parent reply other threads:[~2004-04-28 6:48 UTC|newest] Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top [not found] <20010521155602.2892.goyette@sgi.com> 2004-02-16 5:13 ` pinskia at gcc dot gnu dot org 2004-04-28 1:57 ` pinskia at gcc dot gnu dot org 2004-04-28 7:44 ` bangerth at dealii dot org [this message] 2004-04-28 9:19 ` nathan at gcc dot gnu dot org 2004-04-28 20:26 ` bangerth at dealii dot org 2004-04-29 0:45 ` giovannibajo at libero dot it 2005-02-25 19:47 ` [Bug c++/2892] No array-to-pointer decay happens for template functions pinskia at gcc dot gnu dot org 2005-03-09 18:53 ` mmitchel at gcc dot gnu dot org 2005-03-16 13:17 ` reichelt at gcc dot gnu dot org
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=20040428064811.1309.qmail@sources.redhat.com \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@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).