forked from llvm-mirror/clang
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CodeComplete] Complete enumerators when preferred type is an enum
Reviewers: kadircet Reviewed By: kadircet Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62010 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@360912 91177308-0d34-0410-b5e6-96231b3b80d8
- Loading branch information
1 parent
130af81
commit 60744a8
Showing
2 changed files
with
68 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
namespace N { | ||
enum Color { | ||
Red, | ||
Blue, | ||
Orange, | ||
}; | ||
} | ||
|
||
void test(N::Color color) { | ||
color = N::Color::Red; | ||
test(N::Color::Red); | ||
if (color == N::Color::Red) {} | ||
// FIXME: ideally, we should not show 'Red' on the next line. | ||
else if (color == N::Color::Blue) {} | ||
|
||
// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:10:11 %s -o - | FileCheck %s | ||
// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:11:8 %s -o - | FileCheck %s | ||
// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:12:16 %s -o - | FileCheck %s | ||
// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:14:21 %s -o - | FileCheck %s | ||
// CHECK: Blue : [#N::Color#]N::Blue | ||
// CHECK: color : [#N::Color#]color | ||
// CHECK: Orange : [#N::Color#]N::Orange | ||
// CHECK: Red : [#N::Color#]N::Red | ||
} |