Problem with object initialization
Andrew Pinski
pinskia@gmail.com
Fri Feb 22 20:38:00 GMT 2008
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
More information about the Gcc
mailing list