aboutsummaryrefslogtreecommitdiff
path: root/test/Index/code-completion.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-11-09 21:35:27 +0000
committerDouglas Gregor <dgregor@apple.com>2009-11-09 21:35:27 +0000
commitff4393c1cea81b94ac081bed5c49b8126f12fae8 (patch)
treea1f473fc31b914aecbdb21a8025c65ee3c39b05c /test/Index/code-completion.cpp
parentd411b3f746e612294bd5f0843d83e8c215f7fe58 (diff)
Make sure that we look into nested, transparent declaration contexts
when looking for a name within a given DeclContext. Now enumerators will show up in code-completion results. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86591 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Index/code-completion.cpp')
-rw-r--r--test/Index/code-completion.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/test/Index/code-completion.cpp b/test/Index/code-completion.cpp
index 313e56d733..44bd9d2893 100644
--- a/test/Index/code-completion.cpp
+++ b/test/Index/code-completion.cpp
@@ -2,6 +2,8 @@
#include "nonexistent_header.h"
struct X {
int member;
+
+ enum E { Val1 };
};
struct Y {
@@ -17,7 +19,7 @@ struct Z : X, Y {
struct Z get_Z();
void test_Z() {
- // RUN: c-index-test -code-completion-at=%s:21:11 %s | FileCheck -check-prefix=CHECK-MEMBER %s
+ // RUN: c-index-test -code-completion-at=%s:23:11 %s | FileCheck -check-prefix=CHECK-MEMBER %s
get_Z().member = 17;
}
@@ -27,12 +29,14 @@ double& overloaded(float f, int second);
int& overloaded(Z z, int second);
void test_overloaded() {
- // RUN: c-index-test -code-completion-at=%s:31:18 %s | FileCheck -check-prefix=CHECK-OVERLOAD %s
+ // RUN: c-index-test -code-completion-at=%s:33:18 %s | FileCheck -check-prefix=CHECK-OVERLOAD %s
overloaded(Z(), 0);
}
+// CHECK-MEMBER: EnumDecl:{Informative X::}{TypedText E}
// CHECK-MEMBER: FieldDecl:{TypedText member}
// CHECK-MEMBER: FunctionDecl:{Informative Y::}{TypedText memfunc}{LeftParen (}{Optional {Placeholder int i}}{RightParen )}
+// CHECK-MEMBER: EnumConstantDecl:{Informative E::}{TypedText Val1}
// CHECK-MEMBER: FunctionDecl:{Informative X::}{TypedText ~X}{LeftParen (}{RightParen )}
// CHECK-MEMBER: FunctionDecl:{TypedText operator int}{LeftParen (}{RightParen )}
// CHECK-MEMBER: FunctionDecl:{TypedText operator=}{LeftParen (}{Placeholder struct Z const &}{RightParen )}