From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1336 invoked by alias); 28 Apr 2004 06:48:12 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 1311 invoked by uid 48); 28 Apr 2004 06:48:11 -0000 Date: Wed, 28 Apr 2004 07:44:00 -0000 Message-ID: <20040428064811.1309.qmail@sources.redhat.com> From: "bangerth at dealii dot org" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20010521155602.2892.goyette@sgi.com> References: <20010521155602.2892.goyette@sgi.com> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/2892] array addresses corrupted when using template classes X-Bugzilla-Reason: CC X-SW-Source: 2004-04/txt/msg02722.txt.bz2 List-Id: ------- 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