- Fixup SortCodeCompleteResult() to properly sort keywords on Mac OS (compare was system dependent). Worked on Linux, failed on Mac OS (which caused the recently added testcase to fail on Linux).
- Sort results in testcase.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83597 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaCodeComplete.cpp b/lib/Sema/SemaCodeComplete.cpp
index b648702..d7697a7 100644
--- a/lib/Sema/SemaCodeComplete.cpp
+++ b/lib/Sema/SemaCodeComplete.cpp
@@ -986,7 +986,7 @@
Y.Declaration->getDeclName());
case Result::RK_Keyword:
- return strcmp(X.Keyword, Y.Keyword) == -1;
+ return strcmp(X.Keyword, Y.Keyword) < 0;
}
// Silence GCC warning.