This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: possible parser bug?
- To: JWegher at neonsoft dot com
- Subject: Re: possible parser bug?
- From: Martin von Loewis <martin at mira dot isdn dot cs dot tu-berlin dot de>
- Date: Sat, 7 Nov 1998 11:43:56 +0100
- CC: michael dot iber at siemens dot at, egcs at cygnus dot com
- References: <B1771D049899D011926500A024CA914F01092543@mercury.neonsoft.com>
> 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