diff options
| author | Eric Liu <ioeric@google.com> | 2019-02-21 11:22:58 +0000 |
|---|---|---|
| committer | Eric Liu <ioeric@google.com> | 2019-02-21 11:22:58 +0000 |
| commit | 206740e75679f45525fdb742bfa60fe7c3e6c094 (patch) | |
| tree | 719c5295f8c9214896df5e45a70e3352a6822ef7 /clang/unittests/Sema/CodeCompleteTest.cpp | |
| parent | 7a183a86beb4e5e5f310a6853211009f3d432e57 (diff) | |
| download | bcm5719-llvm-206740e75679f45525fdb742bfa60fe7c3e6c094.tar.gz bcm5719-llvm-206740e75679f45525fdb742bfa60fe7c3e6c094.zip | |
[CodeComplete] Collect visited contexts when scope specifier is invalid.
Summary:
This will allow completion consumers to guess the specified scope by
putting together scopes in the context with the specified scope (e.g. when the
specified namespace is not imported yet).
Reviewers: ilya-biryukov
Subscribers: jdoerfert, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D58446
llvm-svn: 354570
Diffstat (limited to 'clang/unittests/Sema/CodeCompleteTest.cpp')
| -rw-r--r-- | clang/unittests/Sema/CodeCompleteTest.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/clang/unittests/Sema/CodeCompleteTest.cpp b/clang/unittests/Sema/CodeCompleteTest.cpp index 3bec79dc9ad..6bd6074a663 100644 --- a/clang/unittests/Sema/CodeCompleteTest.cpp +++ b/clang/unittests/Sema/CodeCompleteTest.cpp @@ -173,12 +173,16 @@ TEST(SemaCodeCompleteTest, VisitedNSForValidQualifiedId) { "foo::(anonymous)")); } -TEST(SemaCodeCompleteTest, VisitedNSForInvalideQualifiedId) { +TEST(SemaCodeCompleteTest, VisitedNSForInvalidQualifiedId) { auto VisitedNS = runCodeCompleteOnCode(R"cpp( - namespace ns { foo::^ } + namespace na {} + namespace ns1 { + using namespace na; + foo::^ + } )cpp") .VisitedNamespaces; - EXPECT_TRUE(VisitedNS.empty()); + EXPECT_THAT(VisitedNS, UnorderedElementsAre("ns1", "na")); } TEST(SemaCodeCompleteTest, VisitedNSWithoutQualifier) { |

