summaryrefslogtreecommitdiffstats
path: root/lib/Sema/SemaDeclCXX.cpp
diff options
context:
space:
mode:
authorKaelyn Takata <rikka@google.com>2014-12-08 22:41:42 +0000
committerKaelyn Takata <rikka@google.com>2014-12-08 22:41:42 +0000
commite789aab6353992a7a2b63c1f66bb9f78a473ae75 (patch)
tree67d5e9c64d240acc2611a18ae6c004019a15671a /lib/Sema/SemaDeclCXX.cpp
parentf5869c4ac58bc8d1ec1226a8d2cbf6ba8f7f83d1 (diff)
Handle possible TypoExprs in member initializers.
Includes a new test case since none of the existing tests were hitting this code path. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223705 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclCXX.cpp')
-rw-r--r--lib/Sema/SemaDeclCXX.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp
index 583357e234..a6ff02cc07 100644
--- a/lib/Sema/SemaDeclCXX.cpp
+++ b/lib/Sema/SemaDeclCXX.cpp
@@ -2813,6 +2813,11 @@ Sema::BuildMemInitializer(Decl *ConstructorD,
SourceLocation IdLoc,
Expr *Init,
SourceLocation EllipsisLoc) {
+ ExprResult Res = CorrectDelayedTyposInExpr(Init);
+ if (!Res.isUsable())
+ return true;
+ Init = Res.get();
+
if (!ConstructorD)
return true;