diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2013-08-21 19:09:44 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2013-08-21 19:09:44 +0000 |
commit | 1e43d9521f2d8f87156046d550351aafc5db6e5d (patch) | |
tree | f743a526bfd80223034f336aa9ab01f5f101894e /clang/lib/Sema/Sema.cpp | |
parent | bf1adaa05cbd533f24f48a5e63a4c235227a1625 (diff) | |
download | bcm5719-llvm-1e43d9521f2d8f87156046d550351aafc5db6e5d.tar.gz bcm5719-llvm-1e43d9521f2d8f87156046d550351aafc5db6e5d.zip |
Fix the end sourcelocation of the call expression in a member access when
recovering by adding empty parenthesis. Fixes PR16676!
llvm-svn: 188920
Diffstat (limited to 'clang/lib/Sema/Sema.cpp')
-rw-r--r-- | clang/lib/Sema/Sema.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/clang/lib/Sema/Sema.cpp b/clang/lib/Sema/Sema.cpp index 873bfcd3f83..26f26316d1d 100644 --- a/clang/lib/Sema/Sema.cpp +++ b/clang/lib/Sema/Sema.cpp @@ -1306,8 +1306,7 @@ bool Sema::tryToRecoverWithCall(ExprResult &E, const PartialDiagnostic &PD, // arguments and that it returns something of a reasonable type, // so we can emit a fixit and carry on pretending that E was // actually a CallExpr. - SourceLocation ParenInsertionLoc = - PP.getLocForEndOfToken(Range.getEnd()); + SourceLocation ParenInsertionLoc = PP.getLocForEndOfToken(Range.getEnd()); Diag(Loc, PD) << /*zero-arg*/ 1 << Range << (IsCallableWithAppend(E.get()) @@ -1317,8 +1316,8 @@ bool Sema::tryToRecoverWithCall(ExprResult &E, const PartialDiagnostic &PD, // FIXME: Try this before emitting the fixit, and suppress diagnostics // while doing so. - E = ActOnCallExpr(0, E.take(), ParenInsertionLoc, - None, ParenInsertionLoc.getLocWithOffset(1)); + E = ActOnCallExpr(0, E.take(), Range.getEnd(), None, + Range.getEnd().getLocWithOffset(1)); return true; } |