[PATCH] D95439: [clangd] Add include-fixer fixit for field_incomplete_or_sizeless diagnostic.

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 26 08:51:38 PST 2021


kadircet added inline comments.


================
Comment at: clang-tools-extra/clangd/IncludeFixer.cpp:81
   case diag::err_func_def_incomplete_result:
+  case diag::err_field_incomplete_or_sizeless:
     // Incomplete type diagnostics should have a QualType argument for the
----------------
what about the `sizless` case ? we'll attach a fixit, but it is not going to fix the issue :(


================
Comment at: clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp:786
       TU.build().getDiagnostics(),
-      UnorderedElementsAre(
-          AllOf(Diag(Test.range("nested"),
-                     "incomplete type 'ns::X' named in nested name specifier"),
-                DiagName("incomplete_nested_name_spec"),
-                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"),
-                DiagName("incomplete_base_class"),
-                WithFix(Fix(Test.range("insert"), "#include \"x.h\"\n",
-                            "Add include \"x.h\" for symbol ns::X"))),
-          AllOf(Diag(Test.range("access"),
-                     "member access into incomplete type 'ns::X'"),
-                DiagName("incomplete_member_access"),
-                WithFix(Fix(Test.range("insert"), "#include \"x.h\"\n",
-                            "Add include \"x.h\" for symbol ns::X"))),
-          AllOf(
-              Diag(Test.range("type"),
+      testing::UnorderedElementsAreArray(
+          {AllOf(Diag(Test.range("nested"),
----------------
nit: add a `using` decl instead


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D95439



More information about the cfe-commits mailing list