njames93 created this revision. njames93 added a reviewer: sammccall. Herald added subscribers: usaxena95, kadircet, arphaman. njames93 requested review of this revision. Herald added subscribers: cfe-commits, MaskRay, ilya-biryukov. Herald added a project: clang.
clang-tools-extra/clangd/unittests/FindTargetTests.cpp:343:29: warning: ISO C++11 requires at least one argument for the "..." in a variadic macro clang-tools-extra/clangd/unittests/FindTargetTests.cpp:947:35: warning: ISO C++11 requires at least one argument for the "..." in a variadic macro clang-tools-extra/clangd/unittests/SelectionTests.cpp:646:17: warning: suggest explicit braces to avoid ambiguous 'else' [-Wdangling-else] Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D95407 Files: clang-tools-extra/clangd/unittests/FindTargetTests.cpp clang-tools-extra/clangd/unittests/SelectionTests.cpp Index: clang-tools-extra/clangd/unittests/SelectionTests.cpp =================================================================== --- clang-tools-extra/clangd/unittests/SelectionTests.cpp +++ clang-tools-extra/clangd/unittests/SelectionTests.cpp @@ -641,10 +641,11 @@ AST.getASTContext(), AST.getTokens(), Test.point("ambiguous"), Test.point("ambiguous"), [&](SelectionTree T) { // Expect to see the right-biased tree first. - if (Seen == 0) + if (Seen == 0) { EXPECT_EQ("BinaryOperator", nodeKind(T.commonAncestor())); - else if (Seen == 1) + } else if (Seen == 1) { EXPECT_EQ("IntegerLiteral", nodeKind(T.commonAncestor())); + } ++Seen; return false; }); Index: clang-tools-extra/clangd/unittests/FindTargetTests.cpp =================================================================== --- clang-tools-extra/clangd/unittests/FindTargetTests.cpp +++ clang-tools-extra/clangd/unittests/FindTargetTests.cpp @@ -101,6 +101,9 @@ << Code using ExpectedDecls = std::vector<PrintedDecl>; +#define EXPECT_NO_DECLS(NodeType) \ + EXPECT_THAT(assertNodeAndPrintDecls(NodeType), ::testing::IsEmpty()) << Code + TEST_F(TargetDeclTest, Exprs) { Code = R"cpp( int f(); @@ -340,7 +343,7 @@ [[auto]] X = S{}; )cpp"; // FIXME: deduced type missing in AST. https://llvm.org/PR42914 - EXPECT_DECLS("AutoTypeLoc"); + EXPECT_NO_DECLS("AutoTypeLoc"); Code = R"cpp( template <typename... E> @@ -944,7 +947,7 @@ void test(C<[[Foo]]> *p); )cpp"; // FIXME: there's no AST node corresponding to 'Foo', so we're stuck. - EXPECT_DECLS("ObjCObjectTypeLoc"); + EXPECT_NO_DECLS("ObjCObjectTypeLoc"); } class FindExplicitReferencesTest : public ::testing::Test {
Index: clang-tools-extra/clangd/unittests/SelectionTests.cpp =================================================================== --- clang-tools-extra/clangd/unittests/SelectionTests.cpp +++ clang-tools-extra/clangd/unittests/SelectionTests.cpp @@ -641,10 +641,11 @@ AST.getASTContext(), AST.getTokens(), Test.point("ambiguous"), Test.point("ambiguous"), [&](SelectionTree T) { // Expect to see the right-biased tree first. - if (Seen == 0) + if (Seen == 0) { EXPECT_EQ("BinaryOperator", nodeKind(T.commonAncestor())); - else if (Seen == 1) + } else if (Seen == 1) { EXPECT_EQ("IntegerLiteral", nodeKind(T.commonAncestor())); + } ++Seen; return false; }); Index: clang-tools-extra/clangd/unittests/FindTargetTests.cpp =================================================================== --- clang-tools-extra/clangd/unittests/FindTargetTests.cpp +++ clang-tools-extra/clangd/unittests/FindTargetTests.cpp @@ -101,6 +101,9 @@ << Code using ExpectedDecls = std::vector<PrintedDecl>; +#define EXPECT_NO_DECLS(NodeType) \ + EXPECT_THAT(assertNodeAndPrintDecls(NodeType), ::testing::IsEmpty()) << Code + TEST_F(TargetDeclTest, Exprs) { Code = R"cpp( int f(); @@ -340,7 +343,7 @@ [[auto]] X = S{}; )cpp"; // FIXME: deduced type missing in AST. https://llvm.org/PR42914 - EXPECT_DECLS("AutoTypeLoc"); + EXPECT_NO_DECLS("AutoTypeLoc"); Code = R"cpp( template <typename... E> @@ -944,7 +947,7 @@ void test(C<[[Foo]]> *p); )cpp"; // FIXME: there's no AST node corresponding to 'Foo', so we're stuck. - EXPECT_DECLS("ObjCObjectTypeLoc"); + EXPECT_NO_DECLS("ObjCObjectTypeLoc"); } class FindExplicitReferencesTest : public ::testing::Test {
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits