PR4364: fix parsing 'typename' in an expression.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73177 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Parse/ParseExpr.cpp b/lib/Parse/ParseExpr.cpp
index cd62c64..3fee78b 100644
--- a/lib/Parse/ParseExpr.cpp
+++ b/lib/Parse/ParseExpr.cpp
@@ -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();
+ }
+
// postfix-expression: simple-type-specifier '(' expression-list[opt] ')'
//
DeclSpec DS;