Added CXAvailability_NotAccessible to indicate that a declaration is available, but not accessible from the current code completion context.
llvm-svn: 141278
diff --git a/clang/lib/Sema/CodeCompleteConsumer.cpp b/clang/lib/Sema/CodeCompleteConsumer.cpp
index 3db9e4d..ab699382 100644
--- a/clang/lib/Sema/CodeCompleteConsumer.cpp
+++ b/clang/lib/Sema/CodeCompleteConsumer.cpp
@@ -376,7 +376,7 @@
}
}
-void CodeCompletionResult::computeCursorKindAndAvailability() {
+void CodeCompletionResult::computeCursorKindAndAvailability(bool Accessible) {
switch (Kind) {
case RK_Declaration:
// Set the availability based on attributes.
@@ -418,6 +418,9 @@
// Do nothing: Patterns can come with cursor kinds!
break;
}
+
+ if (!Accessible)
+ Availability = CXAvailability_NotAccessible;
}
/// \brief Retrieve the name that should be used to order a result.