This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: possible parser bug?


> Your line:
> 
>   B(GetA()->f());
> 
> looks like a function declaration rather than a constructor, and it's
> invalid syntax for a function declaration.

Although this explanation is correct with regard to the
implementation, it is not with regard to the standard.

There is no way this could be a function declaration: The return type
is missing, so this is clearly a function-style. Of course, g++
assumes "int" here, which is an error.

In addition, this has a class member access in it, so it can be
clearly disambiguated as an expression, according to
[stmt.ambig]. It's just that g++ does not get it right.

Regards,
Martin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]