From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27278 invoked by alias); 19 Nov 2002 15:01:20 -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 27258 invoked by uid 61); 19 Nov 2002 15:01:19 -0000 Date: Mon, 25 Nov 2002 15:13:00 -0000 Message-ID: <20021119150119.27257.qmail@sources.redhat.com> To: gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, gkmohan@ece.arizona.edu, nobody@gcc.gnu.org From: bangerth@dealii.org Reply-To: bangerth@dealii.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, gkmohan@ece.arizona.edu, nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org Subject: Re: c++/8631: bug in typecasting the return value of a function X-SW-Source: 2002-11/txt/msg00955.txt.bz2 List-Id: Synopsis: bug in typecasting the return value of a function State-Changed-From-To: open->closed State-Changed-By: bangerth State-Changed-When: Tue Nov 19 07:01:18 2002 State-Changed-Why: User error. You are trying nonsense and getting nonsense. No surprise. Had you used a static_cast instead of the C-style cast like this: f2( static_cast(&f1), 4 ); then the compiler would tell you quite correctly: tmp/g> /home/bangerth/bin/gcc-3.3x-pre/bin/c++ x.cc x.cc: In function `int main()': x.cc:18: error: invalid static_cast from type `int (*)(int)' to type ` std::complex (*)(int)' http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8631