kadircet created this revision. Herald added subscribers: cfe-commits, arphaman, jkorous, MaskRay, ioeric, ilya-biryukov. kadircet edited the summary of this revision. kadircet added reviewers: sammccall, ilya-biryukov. kadircet added a dependency: D52890: Also report range for the name token on no_member error..
Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D52889 Files: unittests/clangd/ClangdUnitTests.cpp Index: unittests/clangd/ClangdUnitTests.cpp =================================================================== --- unittests/clangd/ClangdUnitTests.cpp +++ unittests/clangd/ClangdUnitTests.cpp @@ -82,6 +82,8 @@ foo()$semicolon[[]]//with comments $unk[[unknown]](); double bar = $type[["foo"]]; + struct Foo { int x; }; Foo a; + a.$nomember[[y]]; } )cpp"); EXPECT_THAT( @@ -103,7 +105,8 @@ Diag(Test.range("unk"), "use of undeclared identifier 'unknown'"), Diag(Test.range("type"), "cannot initialize a variable of type 'double' with an lvalue " - "of type 'const char [4]'"))); + "of type 'const char [4]'"), + Diag(Test.range("nomember"), "no member named 'y' in 'Foo'"))); } TEST(DiagnosticsTest, FlagsMatter) {
Index: unittests/clangd/ClangdUnitTests.cpp =================================================================== --- unittests/clangd/ClangdUnitTests.cpp +++ unittests/clangd/ClangdUnitTests.cpp @@ -82,6 +82,8 @@ foo()$semicolon[[]]//with comments $unk[[unknown]](); double bar = $type[["foo"]]; + struct Foo { int x; }; Foo a; + a.$nomember[[y]]; } )cpp"); EXPECT_THAT( @@ -103,7 +105,8 @@ Diag(Test.range("unk"), "use of undeclared identifier 'unknown'"), Diag(Test.range("type"), "cannot initialize a variable of type 'double' with an lvalue " - "of type 'const char [4]'"))); + "of type 'const char [4]'"), + Diag(Test.range("nomember"), "no member named 'y' in 'Foo'"))); } TEST(DiagnosticsTest, FlagsMatter) {
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits