<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/59171>59171</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [clang-tidy] Clang-tidy incorrectly selects the first available record in compilation_database.json without warning
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          KindDragon
      </td>
    </tr>
</table>

<pre>
    Our GN produce compilation_database.json with several records for same C++ files when we compile it for several toolset, but clang-tidy always silently use first entry.

My suggestion to report error and exit when compilation_database.json contain several records for file.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyFkcGOnDAMhp8GLtYiEgYGDhx2Z7R7WLV9hCoQA1llklEchvL2NUxHc2lVKQq2Yv_-P9N5vbY_5gAf3-EavJ57hN5frsaqaLz7qVVUnSLMvsg7WEycgPCGQVkI2PugCQYfgNQF4ZTINz4wGIsEy4Tc8FBDMPFe-ac7em8JYyJP0M0Reqvc-BKNXkHZRa0ExE0u2hVmQpYMFIHzsGZJfk7y1_v9bQWaxxFpM8uabOrqA1eGwLOU04C_ePDu5d9YvXdRGfdXsg0mS7EVVdVIWR2OdarbQjdFo9JoosU2Kd-e7pPyDKcni3GsxHIbB6HlgCBODx51U2yo4-XcJ3L5f5bveVWLCs64MZ2DbacYr5QUr4l85zNyxdxlLMGJtbfH54X_7BfP5tQQzUgclI04inRqS3kcsMaiyOtmGFB0ohbYl_WxGpryIMqUDaKljTKR0uECuwTHjJqaVuZSCiELUedC1JnqBuzySndCHI66L5NDjhemzDYfmQ9jGtrdUjePxI_WUKTnoyIyo8N9qZu-mpk5tJ_G6XNQo3fpPr3d3f8GB3vxiA">