diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2014-12-16 22:02:06 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2014-12-16 22:02:06 +0000 |
commit | 4d59b77883ab05ed53fb1c3be2663c3af2b6f59d (patch) | |
tree | 298ec70f3f3ece57cb531f4b140f7bfcf85df511 /clang/lib/Sema/SemaExprCXX.cpp | |
parent | 7129c10cae224b1b5a437589794906ef08a84c07 (diff) | |
download | bcm5719-llvm-4d59b77883ab05ed53fb1c3be2663c3af2b6f59d.tar.gz bcm5719-llvm-4d59b77883ab05ed53fb1c3be2663c3af2b6f59d.zip |
Look at whether TransformTypos returned a different Expr instead of looking at the number of uncorrected typos before and after. Correcting one typo may produce an expression with another TypoExpr in it, leading to matching counts even though a typo was corrected.
Fixes PR21925!
llvm-svn: 224380
Diffstat (limited to 'clang/lib/Sema/SemaExprCXX.cpp')
-rw-r--r-- | clang/lib/Sema/SemaExprCXX.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp index 28fb0545ad2..2d3d127618b 100644 --- a/clang/lib/Sema/SemaExprCXX.cpp +++ b/clang/lib/Sema/SemaExprCXX.cpp @@ -6208,10 +6208,11 @@ ExprResult Sema::CorrectDelayedTyposInExpr( auto TyposResolved = DelayedTypos.size(); auto Result = TransformTypos(*this, Filter).Transform(E); TyposResolved -= DelayedTypos.size(); - if (TyposResolved) { + if (Result.isInvalid() || Result.get() != E) { ExprEvalContexts.back().NumTypos -= TyposResolved; return Result; } + assert(TyposResolved == 0 && "Corrected typo but got same Expr back?"); } return E; } |