[cfe-commits] r71897 - in /cfe/trunk: lib/Parse/ParseExpr.cpp test/Parser/cxx-throw.cpp

Eli Friedman eli.friedman at gmail.com
Fri May 15 15:03:17 PDT 2009


On Fri, May 15, 2009 at 2:47 PM, Mike Stump <mrs at apple.com> wrote:
> @@ -228,11 +225,7 @@
>  /// process of disambiguating between an expression and a declaration.
>  Parser::OwningExprResult
>  Parser::ParseExpressionWithLeadingExtension(SourceLocation ExtLoc) {
> -  // FIXME: The handling for throw is almost certainly wrong.
> -  if (Tok.is(tok::kw_throw))
> -    return ParseThrowExpression();
> -
> -  OwningExprResult LHS(ParseCastExpression(false));
> +  OwningExprResult LHS(ParseAssignmentExpression());
>   if (LHS.isInvalid()) return move(LHS);

I'm pretty sure this is wrong; take something like the following in
-pedantic mode:
int a() { int x; __extension__ x = 1i; }

We *should* print a warning because __extension__, as a unary
operator, should only apply to the x.  Also, the assignment operator
should not be a child of the __extension__ operator in the AST.

-Eli




More information about the cfe-commits mailing list