diff options
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Parse/ParseExpr.cpp | 3 | ||||
-rw-r--r-- | clang/lib/Sema/Sema.h | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/Parse/ParseExpr.cpp b/clang/lib/Parse/ParseExpr.cpp index bb6dfcebb57..5eb19d07cd6 100644 --- a/clang/lib/Parse/ParseExpr.cpp +++ b/clang/lib/Parse/ParseExpr.cpp @@ -1365,7 +1365,8 @@ Parser::ParseParenExpression(ParenParseOption &ExprType, bool stopIfCastExpr, // Parse the cast-expression that follows it next. // TODO: For cast expression with CastTy. - Result = ParseCastExpression(false, false, true); + Result = ParseCastExpression(false, false, + Actions.TypeIsVectorType(CastTy)); if (!Result.isInvalid()) Result = Actions.ActOnCastExpr(CurScope, OpenLoc, CastTy, RParenLoc, move(Result)); diff --git a/clang/lib/Sema/Sema.h b/clang/lib/Sema/Sema.h index cff346b9dfc..9e20771b826 100644 --- a/clang/lib/Sema/Sema.h +++ b/clang/lib/Sema/Sema.h @@ -1536,6 +1536,9 @@ public: virtual OwningExprResult ActOnCastExpr(Scope *S, SourceLocation LParenLoc, TypeTy *Ty, SourceLocation RParenLoc, ExprArg Op); + virtual bool TypeIsVectorType(TypeTy *Ty) { + return GetTypeFromParser(Ty)->isVectorType(); + } OwningExprResult MaybeConvertParenListExprToParenExpr(Scope *S, ExprArg ME); OwningExprResult ActOnCastOfParenListExpr(Scope *S, SourceLocation LParenLoc, |