[PATCH] D149165: [clangd] Deduplicate missing-include findings

Artur Gainullin via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Apr 30 22:26:13 PDT 2023


ArturGainullin added a comment.

Hello! After this change IncludeCleaner.GenerateMissingHeaderDiags unit test from ClangdTests.exe is failing on Windows for Debug build.  Could you please take a look.
It looks like error appears because comparator doesn't satisfy strict weak ordering.
I.e. it fails on verification of the comparator (with "invalid comparator" message) at the following line:

  MissingIncludes.erase(llvm::unique(MissingIncludes), MissingIncludes.end());



  [----------] 1 test from IncludeCleaner
  [ RUN      ] IncludeCleaner.GenerateMissingHeaderDiags
  Built preamble of size 193724 for file C:\clangd-test\foo.cpp version null in 0.07 seconds
  Exception Code: 0x80000003
  0x00007FF66CA142FE, C:\iusers\againull\llvm-project\build\tools\clang\tools\extra\clangd\unittests\ClangdTests.exe(0x00007FF666CE0000) + 0x5D342FE byte(s), std::_Debug_lt_pred<`clang::clangd::computeIncludeCleanerFindings'::`2'::<lambda_2> &,clang::clangd::MissingIncludeDiagInfo &,clang::clangd::MissingIncludeDiagInfo &,0>() + 0x8E byte(s), C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.33.31629\include\xutility, line 1532 + 0x55 byte(s)
  0x00007FF66CA1645F, C:\iusers\againull\llvm-project\build\tools\clang\tools\extra\clangd\unittests\ClangdTests.exe(0x00007FF666CE0000) + 0x5D3645F byte(s), std::_Insertion_sort_unchecked<clang::clangd::MissingIncludeDiagInfo *,`clang::clangd::computeIncludeCleanerFindings'::`2'::<lambda_2> >() + 0xAF byte(s), C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.33.31629\include\algorithm, line 7154 + 0x1A byte(s)
  0x00007FF66CA19D05, C:\iusers\againull\llvm-project\build\tools\clang\tools\extra\clangd\unittests\ClangdTests.exe(0x00007FF666CE0000) + 0x5D39D05 byte(s), std::stable_sort<std::_Vector_iterator<std::_Vector_val<std::_Simple_types<clang::clangd::MissingIncludeDiagInfo> > >,`clang::clangd::computeIncludeCleanerFindings'::`2'::<lambda_2> >() + 0xC5 byte(s), C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.33.31629\include\algorithm, line 7714 + 0x0 byte(s)
  0x00007FF66CA19C18, C:\iusers\againull\llvm-project\build\tools\clang\tools\extra\clangd\unittests\ClangdTests.exe(0x00007FF666CE0000) + 0x5D39C18 byte(s), llvm::stable_sort<std::vector<clang::clangd::MissingIncludeDiagInfo,std::allocator<clang::clangd::MissingIncludeDiagInfo> > &,`clang::clangd::computeIncludeCleanerFindings'::`2'::<lambda_2> >() + 0x68 byte(s), C:\iusers\againull\llvm-project\llvm\include\llvm\ADT\STLExtras.h, line 2070 + 0x0 byte(s)
  0x00007FF66CA0CC3A, C:\iusers\againull\llvm-project\build\tools\clang\tools\extra\clangd\unittests\ClangdTests.exe(0x00007FF666CE0000) + 0x5D2CC3A byte(s), clang::clangd::computeIncludeCleanerFindings() + 0x3FA byte(s), C:\iusers\againull\llvm-project\clang-tools-extra\clangd\IncludeCleaner.cpp, line 433 + 0x0 byte(s)
  0x00007FF66CA0CF74, C:\iusers\againull\llvm-project\build\tools\clang\tools\extra\clangd\unittests\ClangdTests.exe(0x00007FF666CE0000) + 0x5D2CF74 byte(s), clang::clangd::issueIncludeCleanerDiagnostics() + 0xF4 byte(s), C:\iusers\againull\llvm-project\clang-tools-extra\clangd\IncludeCleaner.cpp, line 561 + 0x15 byte(s)
  0x00007FF66C1E2385, C:\iusers\againull\llvm-project\build\tools\clang\tools\extra\clangd\unittests\ClangdTests.exe(0x00007FF666CE0000) + 0x5502385 byte(s), clang::clangd::ParsedAST::build() + 0x2C15 byte(s),
  C:\iusers\againull\llvm-project\clang-tools-extra\clangd\ParsedAST.cpp, line 691 + 0x88 byte(s)
  ...


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D149165



More information about the cfe-commits mailing list