<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/63537>63537</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
#include_next <same_header_name> gives error in Clang-based tools, but not Clang
</td>
</tr>
<tr>
<th>Labels</th>
<td>
libclang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
cjdb
</td>
</tr>
</table>
<pre>
Consider this header `stdio.h`:
```cpp
// exists so it can be put in a modulemap...
#include_next <stdio.h>
// and also so we can mark a few things nodiscard
[[nodiscard]] FILE* tmpfile();
[[nodiscard]] FILE* fopen(const char* filename, const char* mode);
// ...
```
this gives the following error in Clang-based tooling (e.g. clangd and a Clang-aware Doxygen), but not Clang:
```
Main file cannot be included recursively when building a preamble clang(pp_including_mainfile_in_preamble)
Unknown type name 'FILE'
```
I don't necessarily know if this is a bug, or if the driver is passing info to Clang so it doesn't error out. Sadly, I can't seem to work it out.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMVE1v4zgM_TXyhajhyPFHDj60TQMU2D0t9hzQFm1rKkuGJDfNv1_QdtAdzCywQJBIIt8j-UgGQ9CDJWpE8SKKc4JLHJ1vuh-qTVqn7s2rs0Er8hBHHWAk5LMosxCVdukoykzkzyI7i-yZz-unm-f9RV6EvAB96RADBAc6QocWWoJ5iaAtIExOLYYmnNM0faBybTuzKLpa-oog8tdHtPxtd_k3PVoFaILjADdaA0zoPwChpxvnbYcA1ikdOvRqh3K5L9-PxVkUZ7i8__Em5DPEae61ISFrIU8if_k_mN7NZIWsO2dDhG5Ev75qQxYnEvIVfrZMTtFP7Fsx3yo81Nyuq_yD_qQAcSTonTHupu0A5L3zLOWrQTs8tRhIQXTOsFHImtIhhY5talNqd8QbeoKz-7oPnPeJM2yXCNbFzePXvm7XP1HbtS5Wmr1bgr1fCjx1iw_6k8wdbiNZaBdtFKeCMHvCqWXcSi_reb5uQG2H64TaMutV2-vDk9NaY_5tP6y7WYj3mYD1BCGrTfnqt0lu3--gnBWyimCpoxDQa3MHpgLdbxOtAyC0y8Dls479Kq_y-pM8G2feEDuAtr2D6DZp9lFWjsJGvzXBLTGFv1CZO7O9sz6rNRBNjL05_8E49ktUk6tTfsKEmkNZV7Ws80ORjA11fd3LvKqP1aHD47E6UV_WmKmeZHXKs0Q3MpN5VsoqOxwORZFihliUbVtnSOWhqsUxowm1SY35nFLnh0SHsFBT5kVeJQZbMmHddymNbvdmSN5-3zDkqV2GII6Z4a39Jok6Gmp-t5w40XX7Z7ius56_7ZP6n7MZfpm2ZPGmGWOcA8_duguDjuPSpp2bhLxwGvvP0-zdD-qikJe1sCDkZa3tnwAAAP__B_WEmQ">