[cfe-commits] r73177 - in /cfe/trunk: lib/Parse/ParseExpr.cpp test/SemaCXX/typename-expression.cpp
Douglas Gregor
dgregor at apple.com
Wed Jun 10 17:41:20 PDT 2009
On Jun 10, 2009, at 5:33 PM, Eli Friedman wrote:
> Author: efriedma
> Date: Wed Jun 10 19:33:41 2009
> New Revision: 73177
>
> URL: http://llvm.org/viewvc/llvm-project?rev=73177&view=rev
> Log:
> PR4364: fix parsing 'typename' in an expression.
Thanks, Eli!
> Added:
> cfe/trunk/test/SemaCXX/typename-expression.cpp
> Modified:
> cfe/trunk/lib/Parse/ParseExpr.cpp
>
> Modified: cfe/trunk/lib/Parse/ParseExpr.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseExpr.cpp?rev=73177&r1=73176&r2=73177&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- cfe/trunk/lib/Parse/ParseExpr.cpp (original)
> +++ cfe/trunk/lib/Parse/ParseExpr.cpp Wed Jun 10 19:33:41 2009
> @@ -749,7 +749,13 @@
> Diag(Tok, diag::err_expected_expression);
> return ExprError();
> }
> -
> +
> + if (SavedKind == tok::kw_typename) {
> + // postfix-expression: typename-specifier '(' expression-
> list[opt] ')'
> + if (!TryAnnotateTypeOrScopeToken())
> + return ExprError();
> + }
> +
Looks good.
- Doug
More information about the cfe-commits
mailing list