From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29172 invoked by alias); 10 Sep 2002 06:23:38 -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 28667 invoked from network); 10 Sep 2002 06:22:27 -0000 Received: from unknown (HELO mailout09.sul.t-online.com) (194.25.134.84) by sources.redhat.com with SMTP; 10 Sep 2002 06:22:27 -0000 Received: from fwd02.sul.t-online.de by mailout09.sul.t-online.com with smtp id 17oePm-0000y8-03; Tue, 10 Sep 2002 08:22:22 +0200 Received: from p508B9D51.dip.t-dialin.net (0620532566-0001@[80.139.157.81]) by fwd02.sul.t-online.com with esmtp id 17oePW-1AvXBQC; Tue, 10 Sep 2002 08:22:06 +0200 From: Ritzert@t-online.de (Michael Ritzert) To: Matt Austern Subject: Re: Is this a bug? Date: Tue, 10 Sep 2002 01:06:00 -0000 User-Agent: KMail/1.4.6 Cc: gcc-bugs@gcc.gnu.org References: <2A1686ED-BF81-11D6-967F-00039390D9E0@apple.com> In-Reply-To: <2A1686ED-BF81-11D6-967F-00039390D9E0@apple.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Content-Disposition: inline Message-Id: <200209100822.14569.ritzert@t-online.de> X-Sender: 0620532566-0001@t-dialin.net X-SW-Source: 2002-09/txt/msg00192.txt.bz2 List-Id: Just back from a week-long holiday... Am Dienstag, 3. September 2002 23:07 schrieb Matt Austern: > On Friday, August 30, 2002, at 02:39 AM, Ritzert@t-online.de wrote: > > Hi all, > > > > Since 2002-08-26 I'm unable to compile STLPort with gcc HEAD. I have > > stripped down the STLPort code to this small testcase: > > > > # cat x.cpp > > template > > inline const _Tp& max(const _Tp& __a, const _Tp& __b) > > { return __a < __b ? __b : __a; } > > > > void append() > > { > > const unsigned __old_size = 3; > > int __n = 7; > > max(__old_size, static_cast(__n)); > > } > > I think the compiler is wrong to complain. It's true that > static_cast(__n) is an rvalue. However, binding > a const reference to an rvalue is legal. Thanks, that's exactly the point I was uncertain about. Ok, so I will file a bug report with this further reduced testcase shortly: int main() { int bar = 7; const unsigned& foo = static_cast(bar); } Michael