[cfe-commits] r72279 - /cfe/trunk/lib/Parse/ParseExprCXX.cpp
Douglas Gregor
dgregor at apple.com
Fri May 22 14:32:17 PDT 2009
On May 22, 2009, at 2:09 PM, Argiris Kirtzidis wrote:
> Author: akirtzidis
> Date: Fri May 22 16:09:47 2009
> New Revision: 72279
>
> URL: http://llvm.org/viewvc/llvm-project?rev=72279&view=rev
> Log:
> The disambiguation process for ambiguous paren expressions is not
> "side effects free", e.g:
>
> (T(*)(int[x+y]));
>
> is an (invalid) paren expression, but "x+y" will be parsed as part
> of the (rejected) type-id,
> so unnecessary Action calls are made for an unused (and possibly
> leaked) "x+y".
>
> Use a different scheme, similar to parsing inline methods. The
> parenthesized tokens are cached,
> the context that follows is determined (possibly by parsing a cast-
> expression),
> and then we re-introduce the cached tokens into the token stream and
> parse them appropriately.
Very nice! Can you think of any way to actually test this? Perhaps we
would end up getting a particular warning twice (once during
disambiguation, once later)?
- Doug
More information about the cfe-commits
mailing list