summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/SemaStmt.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaStmt.cpp b/clang/lib/Sema/SemaStmt.cpp
index 4ef0fda3612..bbcc71d6e4d 100644
--- a/clang/lib/Sema/SemaStmt.cpp
+++ b/clang/lib/Sema/SemaStmt.cpp
@@ -687,10 +687,14 @@ Sema::ActOnGotoStmt(SourceLocation GotoLoc, SourceLocation LabelLoc,
Action::OwningStmtResult
Sema::ActOnIndirectGotoStmt(SourceLocation GotoLoc,SourceLocation StarLoc,
ExprArg DestExp) {
- // FIXME: Verify that the operand is convertible to void*.
// Convert operand to void*
- Expr* E = (Expr*)DestExp.release();
- ImpCastExprToType(E, Context.VoidPtrTy);
+ Expr* E = DestExp.takeAs<Expr>();
+ QualType ETy = E->getType();
+ AssignConvertType ConvTy =
+ CheckSingleAssignmentConstraints(Context.VoidPtrTy, E);
+ if (DiagnoseAssignmentResult(ConvTy, StarLoc, Context.VoidPtrTy, ETy,
+ E, "passing"))
+ return StmtError();
return Owned(new (Context) IndirectGotoStmt(E));
}
OpenPOWER on IntegriCloud