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.
>
>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



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