[PATCH] D72355: [clangd] Assert that the testcases in FindExplicitReferencesTest.All have no diagnostics

Nathan Ridge via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 9 14:09:53 PST 2020


nridge updated this revision to Diff 237193.
nridge added a comment.

Address review comments


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D72355/new/

https://reviews.llvm.org/D72355

Files:
  clang-tools-extra/clangd/unittests/FindTargetTests.cpp


Index: clang-tools-extra/clangd/unittests/FindTargetTests.cpp
===================================================================
--- clang-tools-extra/clangd/unittests/FindTargetTests.cpp
+++ clang-tools-extra/clangd/unittests/FindTargetTests.cpp
@@ -566,6 +566,10 @@
     TU.ExtraArgs.push_back("-std=c++17");
 
     auto AST = TU.build();
+    for (auto &D : AST.getDiagnostics()) {
+      if (D.Severity > DiagnosticsEngine::Warning)
+        ADD_FAILURE() << D << Code;
+    }
 
     auto *TestDecl = &findDecl(AST, "foo");
     if (auto *T = llvm::dyn_cast<FunctionTemplateDecl>(TestDecl))
@@ -718,7 +722,7 @@
         "3: targets = {vb}, decl\n"},
        // MemberExpr should know their using declaration.
        {R"cpp(
-            struct X { void func(int); }
+            struct X { void func(int); };
             struct Y : X {
               using X::func;
             };
@@ -824,7 +828,7 @@
             void foo() {
               $0^TT<int> $1^x;
               $2^foo<$3^TT>();
-              $4^foo<$5^vector>()
+              $4^foo<$5^vector>();
               $6^foo<$7^TP...>();
             }
         )cpp",
@@ -891,7 +895,7 @@
                };
                // delegating initializer
                class $10^Foo {
-                 $11^Foo(int);
+                 $11^Foo(int) {}
                  $12^Foo(): $13^Foo(111) {}
                };
              }
@@ -924,7 +928,7 @@
        // Namespace aliases should be handled properly.
        {
            R"cpp(
-                namespace ns { struct Type {} }
+                namespace ns { struct Type {}; }
                 namespace alias = ns;
                 namespace rec_alias = alias;
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72355.237193.patch
Type: text/x-patch
Size: 1687 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200109/e6dd81ee/attachment.bin>


More information about the cfe-commits mailing list