summaryrefslogtreecommitdiffstats
path: root/clang/Sema
diff options
context:
space:
mode:
Diffstat (limited to 'clang/Sema')
-rw-r--r--clang/Sema/SemaStmt.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/Sema/SemaStmt.cpp b/clang/Sema/SemaStmt.cpp
index 18957240974..da2d12bfaf1 100644
--- a/clang/Sema/SemaStmt.cpp
+++ b/clang/Sema/SemaStmt.cpp
@@ -27,7 +27,7 @@ Sema::StmtResult Sema::ParseExprStmt(ExprTy *expr) {
// Exprs are statements, so there is no need to do a conversion here. However,
// diagnose some potentially bad code.
- if (!E->hasLocalSideEffect())
+ if (!E->hasLocalSideEffect() && !E->getType()->isVoidType())
Diag(E->getExprLoc(), diag::warn_unused_expr, E->getSourceRange());
return E;
OpenPOWER on IntegriCloud