forked from OSchip/llvm-project
Fix a GCC warning:
SemaExpr.cpp:561: warning: dereferencing type-punned pointer will break strict-aliasing rules Patch by Benoit Boissinot! llvm-svn: 39928
This commit is contained in:
parent
e73e4322d6
commit
daaa9f207c
|
@ -558,11 +558,13 @@ Action::ExprResult Sema::ParseConditionalOp(SourceLocation QuestionLoc,
|
|||
SourceLocation ColonLoc,
|
||||
ExprTy *Cond, ExprTy *LHS,
|
||||
ExprTy *RHS) {
|
||||
QualType result = CheckConditionalOperands((Expr *&)Cond, (Expr *&)LHS,
|
||||
(Expr *&)RHS, QuestionLoc);
|
||||
Expr *CondExpr = (Expr *) Cond;
|
||||
Expr *LHSExpr = (Expr *) LHS, *RHSExpr = (Expr *) RHS;
|
||||
QualType result = CheckConditionalOperands(CondExpr, LHSExpr,
|
||||
RHSExpr, QuestionLoc);
|
||||
if (result.isNull())
|
||||
return true;
|
||||
return new ConditionalOperator((Expr*)Cond, (Expr*)LHS, (Expr*)RHS, result);
|
||||
return new ConditionalOperator(CondExpr, LHSExpr, RHSExpr, result);
|
||||
}
|
||||
|
||||
// promoteExprToType - a helper function to ensure we create exactly one
|
||||
|
|
Loading…
Reference in New Issue