[PATCH] D51924: [clangd] Add unittests for D51917
Kadir Cetinkaya via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 11 08:13:36 PDT 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL341950: [clangd] Add unittests for D51917 (authored by kadircet, committed by ).
Herald added a subscriber: llvm-commits.
Changed prior to commit:
https://reviews.llvm.org/D51924?vs=164845&id=164886#toc
Repository:
rL LLVM
https://reviews.llvm.org/D51924
Files:
clang-tools-extra/trunk/unittests/clangd/CodeCompleteTests.cpp
Index: clang-tools-extra/trunk/unittests/clangd/CodeCompleteTests.cpp
===================================================================
--- clang-tools-extra/trunk/unittests/clangd/CodeCompleteTests.cpp
+++ clang-tools-extra/trunk/unittests/clangd/CodeCompleteTests.cpp
@@ -1967,6 +1967,45 @@
}
}
+TEST(SignatureHelpTest, ConstructorInitializeFields) {
+ {
+ const auto Results = signatures(R"cpp(
+ struct A {
+ A(int);
+ };
+ struct B {
+ B() : a_elem(^) {}
+ A a_elem;
+ };
+ )cpp");
+ EXPECT_THAT(Results.signatures, UnorderedElementsAre(
+ Sig("A(int)", {"int"}),
+ Sig("A(A &&)", {"A &&"}),
+ Sig("A(const A &)", {"const A &"})
+ ));
+ }
+ {
+ const auto Results = signatures(R"cpp(
+ struct A {
+ A(int);
+ };
+ struct C {
+ C(int);
+ C(A);
+ };
+ struct B {
+ B() : c_elem(A(1^)) {}
+ C c_elem;
+ };
+ )cpp");
+ EXPECT_THAT(Results.signatures, UnorderedElementsAre(
+ Sig("A(int)", {"int"}),
+ Sig("A(A &&)", {"A &&"}),
+ Sig("A(const A &)", {"const A &"})
+ ));
+ }
+}
+
} // namespace
} // namespace clangd
} // namespace clang
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51924.164886.patch
Type: text/x-patch
Size: 1257 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180911/fc932216/attachment.bin>
More information about the llvm-commits
mailing list