diff options
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index 55f9d6f8a08..b2bff51cd95 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -5138,6 +5138,10 @@ Sema::ActOnCastExpr(Scope *S, SourceLocation LParenLoc, CastExpr = Result.take(); } + if (getLangOpts().CPlusPlus && !castType->isVoidType()) + Diag(CastExpr->getLocStart(), diag::warn_old_style_cast) + << SourceRange(LParenLoc, RParenLoc); + return BuildCStyleCastExpr(LParenLoc, castTInfo, RParenLoc, CastExpr); } |