From 3a69eafa8845e1f440cff77ecabd3daf1588adb5 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Fri, 18 Feb 2011 23:30:37 +0000 Subject: When code-completing a case statement for a switch on a value of enumeration type, prioritize the enumeration constants and don't provide completions for any other expressions. Fixes . llvm-svn: 125991 --- clang/lib/Frontend/ASTUnit.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'clang/lib/Frontend/ASTUnit.cpp') diff --git a/clang/lib/Frontend/ASTUnit.cpp b/clang/lib/Frontend/ASTUnit.cpp index 46f5b5a48e7..4a5a51d9f1d 100644 --- a/clang/lib/Frontend/ASTUnit.cpp +++ b/clang/lib/Frontend/ASTUnit.cpp @@ -333,8 +333,8 @@ void ASTUnit::CacheCodeCompletionResults() { | (1 << (CodeCompletionContext::CCC_ObjCMessageReceiver - 1)) | (1 << (CodeCompletionContext::CCC_MacroNameUse - 1)) | (1 << (CodeCompletionContext::CCC_PreprocessorExpression - 1)) - | (1 << (CodeCompletionContext::CCC_ParenthesizedExpression - 1)); - + | (1 << (CodeCompletionContext::CCC_ParenthesizedExpression - 1)) + | (1 << (CodeCompletionContext::CCC_OtherWithMacros - 1)); CachedResult.Priority = Results[I].Priority; CachedResult.Kind = Results[I].CursorKind; @@ -1790,6 +1790,7 @@ static void CalculateHiddenNames(const CodeCompletionContext &Context, case CodeCompletionContext::CCC_SelectorName: case CodeCompletionContext::CCC_TypeQualifiers: case CodeCompletionContext::CCC_Other: + case CodeCompletionContext::CCC_OtherWithMacros: // We're looking for nothing, or we're looking for names that cannot // be hidden. return; -- cgit v1.2.3