[clang] [Clang] Match MSVC handling of duplicate header search paths in Microsoft compatibility modes. (PR #105738)

via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 22 14:49:05 PDT 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff e49068624c48f4d906707b32b31f6a1d561605be b4b550f2dbf47dbce0acd9388fe3c8c8d1cb7ce9 --extensions cpp,c -- clang/test/Driver/header-search-duplicates.c clang/test/Driver/microsoft-header-search-duplicates.c clang/lib/Lex/InitHeaderSearch.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang/lib/Lex/InitHeaderSearch.cpp b/clang/lib/Lex/InitHeaderSearch.cpp
index a4cba469cd..3f487f3a4c 100644
--- a/clang/lib/Lex/InitHeaderSearch.cpp
+++ b/clang/lib/Lex/InitHeaderSearch.cpp
@@ -512,8 +512,8 @@ void InitHeaderSearch::Realize(const LangOptions &Lang) {
   // Remove duplicates across both the Angled and System directories.  GCC does
   // this and failing to remove duplicates across these two groups breaks
   // #include_next.
-  unsigned NonSystemRemoved = RemoveDuplicates(Lang, SearchList, NumQuoted,
-                                               Verbose);
+  unsigned NonSystemRemoved =
+      RemoveDuplicates(Lang, SearchList, NumQuoted, Verbose);
   NumAngled -= NonSystemRemoved;
 
   Headers.SetSearchPaths(extractLookups(SearchList), NumQuoted, NumAngled,

``````````

</details>


https://github.com/llvm/llvm-project/pull/105738


More information about the cfe-commits mailing list