From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14823 invoked by alias); 8 May 2003 23:26:00 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 14807 invoked by uid 71); 8 May 2003 23:26:00 -0000 Date: Thu, 08 May 2003 23:26:00 -0000 Message-ID: <20030508232600.14806.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: "Giovanni Bajo" Subject: Re: c++/1833: [2003-01-01] inlining sometimes causes incorrect behavior Reply-To: "Giovanni Bajo" X-SW-Source: 2003-05/txt/msg00673.txt.bz2 List-Id: The following reply was made to PR c++/1833; it has been noted by GNATS. From: "Giovanni Bajo" To: , , , , Cc: Subject: Re: c++/1833: [2003-01-01] inlining sometimes causes incorrect behavior Date: Fri, 9 May 2003 01:17:04 +0200 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=1833 Given Alexander's analysys, which I confirm, this PR boils down to the following code: -------------------------------- typedef char *pchar; void func(pchar &s) {} int main () { char *s = "123"; func((pchar)s); } -------------------------------- which is illegal, because the cast creates a temporary rvalue which cannot be bound to a non-const reference. But GCC compiles it happily even with -ansi -pedantic. So it's an accept-illegal. Giovanni Bajo