<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/142119>142119</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang-tidy does not respect clang++.cfg
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang,
clang-tidy
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
smuzaffar
</td>
</tr>
</table>
<pre>
Hi,
In order to use gcc headers from our custom gcc installation we create `llvm/bin/clang++.cfg` file with contents like [a] in it. This allows us to use `clang++` with explicitly setting `--gcc-toolchain` via command line. Looks like `clang-tidy` does not respect `llvm/bin/clang++.cfg` and fails with errors like [b].
`clang-tidy` works if I pass `--extra-arg="--gcc-toolchain=/path/to/custon/gcc". I tried creating `llvm/bin/clang-tidy.cfg` hoping that `clang-tidy` might read it but this did not work.
Is it on purpose that `clang-tidy` does not respect `clang++.cfg` file?
[a]
```
> cat bin/clang++.cfg
--gcc-toolchain=/path/el8_amd64_gcc12/external/gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28
--target=x86_64-redhat-linux-gnu
```
[b]
```
Error while processing .../src/TestSubsystem/TestDQMAnalyzerStream/plugins/TestDQMAnalyzerStream.cc.
.../el8_amd64_gcc12/lcg/root/6.32.13-4719c3acec5bf7dbc47dbafce0eb285d/include/TString.h:39:12: error: 'compare' file not found [clang-diagnostic-error]
39 | # include <compare>
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyMVEtv4zgT_DX0pSGBIvWwDjo44xG-AN8eFpl7QJEtiRuKFEgqj_n1C9oykk1mH4APEt0qVlVXtwhBTxaxI9Udqc4HscXZ-S4s208xjsIfBqfeuv9pwr4ReoJ7C84r9BAdbAFhkhJmFAp9gNG7BdzmQW4huuXyn7YhCmNE1M7CC4L0KCICqakxzwth_aAtYb00wk6E3RF2l8txIjWFURuEFx1nkM5GtDGA0U8IpLoTpDqDtqBjDj9mHUAY414CbO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