summaryrefslogtreecommitdiffstats
path: root/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
commit8ba90762ae771fc55cc99e6b5497f9469aaef1b7 (patch)
tree2cd267e2e760fc7975fa08d4e0bb0f8535bfb4fb /lib/Sema/SemaExpr.cpp
parent6d49f699dca8743f419850cc120ca0b7c9c45f32 (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222694 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r--lib/Sema/SemaExpr.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index fd7c76121d..223e93e7c3 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/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);