[PATCH] D95407: [clangd] NFC Silence some buildbot warnings

Nathan James via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 25 16:07:35 PST 2021


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 {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D95407.319157.patch
Type: text/x-patch
Size: 1838 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210126/3f97b640/attachment.bin>


More information about the cfe-commits mailing list