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, egcs at cygnus dot com
- Subject: RE: possible parser bug?
- From: Michael Iber <michael dot iber at siemens dot at>
- Date: Mon, 09 Nov 1998 13:38:20 +0100
>Your line:
>
> B(GetA()->f());
>
>looks like a function declaration rather than a constructor, and it's
>invalid syntax for a function declaration.
>
>Try B aB(GetA()->f());
>
>Works fine.
It should be a constructor, but I think the example was too short.
I use code like this
if (flag)
B(GetA()->f()).Execute();
e.g to display a modal window on screen, depending on some condition.
An instance of B is created only to call Execute() and destroyed
automatically after the call.
There the parse error occurs. It works fine for function calls.
mike