summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/unittests/clangd/DiagnosticsTests.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/unittests/clangd/DiagnosticsTests.cpp')
-rw-r--r--clang-tools-extra/unittests/clangd/DiagnosticsTests.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang-tools-extra/unittests/clangd/DiagnosticsTests.cpp b/clang-tools-extra/unittests/clangd/DiagnosticsTests.cpp
index f6f6de396ab..bbd94b80eea 100644
--- a/clang-tools-extra/unittests/clangd/DiagnosticsTests.cpp
+++ b/clang-tools-extra/unittests/clangd/DiagnosticsTests.cpp
@@ -311,6 +311,7 @@ TEST(IncludeFixerTest, IncompleteType) {
Annotations Test(R"cpp(
$insert[[]]namespace ns {
class X;
+ $nested[[X::]]Nested n;
}
class Y : $base[[public ns::X]] {};
int main() {
@@ -326,6 +327,10 @@ int main() {
EXPECT_THAT(
TU.build().getDiagnostics(),
UnorderedElementsAre(
+ AllOf(Diag(Test.range("nested"),
+ "incomplete type 'ns::X' named in nested name specifier"),
+ WithFix(Fix(Test.range("insert"), "#include \"x.h\"\n",
+ "Add include \"x.h\" for symbol ns::X"))),
AllOf(Diag(Test.range("base"), "base class has incomplete type"),
WithFix(Fix(Test.range("insert"), "#include \"x.h\"\n",
"Add include \"x.h\" for symbol ns::X"))),
OpenPOWER on IntegriCloud