forked from OSchip/llvm-project
Fix a recent regression probably caused by addition of altivec-style
type-casts in the parser. llvm-svn: 89691
This commit is contained in:
parent
75e6a40d6d
commit
3f21c159dc
|
@ -1048,6 +1048,10 @@ public:
|
|||
return ExprEmpty();
|
||||
}
|
||||
|
||||
virtual bool TypeIsVectorType(TypeTy *Ty) {
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual OwningExprResult ActOnBinOp(Scope *S, SourceLocation TokLoc,
|
||||
tok::TokenKind Kind,
|
||||
ExprArg LHS, ExprArg RHS) {
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -12,3 +12,7 @@ void bar() {
|
|||
a = (char*)b; // expected-error {{cannot be cast to a pointer type}}
|
||||
}
|
||||
|
||||
long bar1(long *next) {
|
||||
return (long)(*next)++;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue