summaryrefslogtreecommitdiff
path: root/contrib/llvm/tools/clang/lib/Sema/SemaCodeComplete.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-01-06 20:24:06 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-01-06 20:24:06 +0000
commit95ec533a1d8c450f6c6c5e84fe85423960e13382 (patch)
treebfe77b0dccd50ed2f4b4e6299d4bc4eaafced6e7 /contrib/llvm/tools/clang/lib/Sema/SemaCodeComplete.cpp
parent2b532af82919b9141e7fd04becf354a0a7dfa813 (diff)
parent7e7b6700743285c0af506ac6299ddf82ebd434b9 (diff)
Notes
Diffstat (limited to 'contrib/llvm/tools/clang/lib/Sema/SemaCodeComplete.cpp')
-rw-r--r--contrib/llvm/tools/clang/lib/Sema/SemaCodeComplete.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/contrib/llvm/tools/clang/lib/Sema/SemaCodeComplete.cpp b/contrib/llvm/tools/clang/lib/Sema/SemaCodeComplete.cpp
index 3eef366b75b3..94cfc4baca51 100644
--- a/contrib/llvm/tools/clang/lib/Sema/SemaCodeComplete.cpp
+++ b/contrib/llvm/tools/clang/lib/Sema/SemaCodeComplete.cpp
@@ -3720,9 +3720,17 @@ static void AddObjCProperties(
Builder.AddPlaceholderChunk(
Builder.getAllocator().CopyString(PlaceholderStr));
+ // When completing blocks properties that return void the default
+ // property completion result should show up before the setter,
+ // otherwise the setter completion should show up before the default
+ // property completion, as we normally want to use the result of the
+ // call.
Results.MaybeAddResult(
Result(Builder.TakeString(), P,
- Results.getBasePriority(P) + CCD_BlockPropertySetter),
+ Results.getBasePriority(P) +
+ (BlockLoc.getTypePtr()->getReturnType()->isVoidType()
+ ? CCD_BlockPropertySetter
+ : -CCD_BlockPropertySetter)),
CurContext);
}
};