[clang] [llvm] [Clang] Match MSVC handling of duplicate header search paths in Microsoft compatibility modes. (PR #105738)
Shafik Yaghmour via cfe-commits
cfe-commits at lists.llvm.org
Fri Dec 6 17:33:32 PST 2024
================
@@ -3190,19 +3190,27 @@ static void GenerateHeaderSearchArgs(const HeaderSearchOptions &Opts,
auto It = Opts.UserEntries.begin();
auto End = Opts.UserEntries.end();
- // Add -I... and -F... options in order.
- for (; It < End && Matches(*It, {frontend::Angled}, std::nullopt, true);
+ // Add the -I..., -F..., and -iexternal options in order.
+ for (; It < End && Matches(*It, {frontend::Angled, frontend::External},
+ std::nullopt, true);
++It) {
OptSpecifier Opt = [It, Matches]() {
if (Matches(*It, frontend::Angled, true, true))
return OPT_F;
if (Matches(*It, frontend::Angled, false, true))
return OPT_I;
+ if (Matches(*It, frontend::External, false, true))
----------------
shafik wrote:
We should be striving to use [bugprone-argument-comment](https://clang.llvm.org/extra/clang-tidy/checks/bugprone/argument-comment.html) for literals like this. It looks like we do so below, it is unfortunate it is not applied consistently.
https://github.com/llvm/llvm-project/pull/105738
More information about the cfe-commits
mailing list