diff options
author | Manman Ren <manman.ren@gmail.com> | 2016-06-02 00:11:03 +0000 |
---|---|---|
committer | Manman Ren <manman.ren@gmail.com> | 2016-06-02 00:11:03 +0000 |
commit | d063c5a1813f759720d59a571d0b22493a930f1e (patch) | |
tree | d2bd1488bce4970d1f8e98e68f137a5a808a6651 /clang/lib/Sema/SemaDecl.cpp | |
parent | 7b8ed4f223669068563c8ee2f17b86825c72e2c9 (diff) | |
download | bcm5719-llvm-d063c5a1813f759720d59a571d0b22493a930f1e.tar.gz bcm5719-llvm-d063c5a1813f759720d59a571d0b22493a930f1e.zip |
FixIt: use getLocForEndOfToken to insert fix-it after a type name.
Instead of setting DeclSpec's range end to point to the next token
after the DeclSpec, we use getLocForEndOfToken to insert fix-it after a type
name.
Before this fix, fix-it will change
^(NSView view) to ^(*NSView view)
This commit correctly updates the source to ^(NSView* view).
rdar://21042144
Differential Revision: http://reviews.llvm.org/D20844
llvm-svn: 271448
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 64da16add18..fab72f36605 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -10954,7 +10954,8 @@ ParmVarDecl *Sema::CheckParameter(DeclContext *DC, SourceLocation StartLoc, // Parameter declarators cannot be interface types. All ObjC objects are // passed by reference. if (T->isObjCObjectType()) { - SourceLocation TypeEndLoc = TSInfo->getTypeLoc().getLocEnd(); + SourceLocation TypeEndLoc = + getLocForEndOfToken(TSInfo->getTypeLoc().getLocEnd()); Diag(NameLoc, diag::err_object_cannot_be_passed_returned_by_value) << 1 << T << FixItHint::CreateInsertion(TypeEndLoc, "*"); |