This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Problem with object initialization
- From: "Andrew Pinski" <pinskia at gmail dot com>
- To: "Rodolfo Schulz de Lima" <rodolfo at rodsoft dot org>
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 22 Feb 2008 12:38:35 -0800
- Subject: Re: Problem with object initialization
- References: <fpnbgv$igu$1@ger.gmane.org>
On Fri, Feb 22, 2008 at 12:29 PM, Rodolfo Schulz de Lima
<rodolfo@rodsoft.org> wrote:
> Hi, I'd like to know why this rather simple code doesn't compile on gcc
> (from 4.2 to 4.3, haven't tested on earlier compilers):
This is not the correct mailing list for this really, please use
gcc-help@ or in this case a C++ language list.
> Now... why the compiler assumed that I'm defining a function returning
> 'test' and accepting a pointer to a function returning 'data'? If I
> wanted this, I'd write: test a(data(*)()), isn't it? What's the catch?
Because of an ambiguous in the C++ syntax, the C++ standard decided
that this will be a function named a returning the type test and
taking an argument of the type data.
This is not a bug in GCC or the C++ standard either.
Thanks,
Andrew Pinski