summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorKaelyn Takata <rikka@google.com>2014-11-24 21:46:59 +0000
committerKaelyn Takata <rikka@google.com>2014-11-24 21:46:59 +0000
commit13da33fdfe480ac6ecbddf95524cc870dc9bd4ef (patch)
tree76c269d8b03f4ffd2128c9c32625160cf1a2e0cc /clang/lib/Sema/SemaExpr.cpp
parent074bbb698db6f2b4559a65a247e9d7aa0686de94 (diff)
downloadbcm5719-llvm-13da33fdfe480ac6ecbddf95524cc870dc9bd4ef.tar.gz
bcm5719-llvm-13da33fdfe480ac6ecbddf95524cc870dc9bd4ef.zip
Force the correction of delayed typos in casts in non-C++ code.
Fixes PR21656, which is fallout from r222551 caused by an untested/missed code path. llvm-svn: 222694
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index fd7c76121db..223e93e7c3d 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -5299,6 +5299,12 @@ Sema::ActOnCastExpr(Scope *S, SourceLocation LParenLoc,
if (getLangOpts().CPlusPlus) {
// Check that there are no default arguments (C++ only).
CheckExtraCXXDefaultArguments(D);
+ } else {
+ // Make sure any TypoExprs have been dealt with.
+ ExprResult Res = CorrectDelayedTyposInExpr(CastExpr);
+ if (!Res.isUsable())
+ return ExprError();
+ CastExpr = Res.get();
}
checkUnusedDeclAttributes(D);
OpenPOWER on IntegriCloud