This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PR c++/26997 g++ reports misleading error message when the identifier with error occurs earlier on the same line
2008/10/27 Mark Mitchell <mark@codesourcery.com>:
> What I found a bit conceptually ugly here was that we're depending on
> the type possibly casted-to, rather than some syntactic property. It
> means, for example, that we'll handle:
>
> typedef void T();
> ... (T)x ...
>
> differently than:
>
> typedef void *T;
> ... (T)x ...
>
> In other words, we're not noticing the form "T()" but rather the fact
> that it happens to be a FUNCTION_TYPE.
Well, it is not clear to me (and the code does not explain) in which
cases a function cast can be confused with a constructor and what
should happen in each of those cases. I have tried to build some
testcases using such a function cast and I always get 'invalid cast to
function type'. If someone cared to explain, I could try something
else.
Cheers,
Manuel.