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

    <tr>
        <th>Summary</th>
        <td>
            [LIBC++]: Transitive include
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            libc++
      </td>
    </tr>

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

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

<pre>
    ### [Clang 17.0.2](https://github.com/llvm/llvm-project/tree/b2417f51dbbd7435eb3aaf203de24de6754da50e)

```c++
#include <format>

int main()
{
    std::array<int, 5> test_array{};
}
```

Compiles on [libc++](https://github.com/llvm/llvm-project/tree/b2417f51dbbd7435eb3aaf203de24de6754da50e)

Error on gcc 13.2.1

```sh
clang -H TransitiveArray.cpp
```
```
. /usr/lib64/gcc/x86_64-pc-linux-gnu/13.2.1/../../../../include/c++/13.2.1/format
.. /usr/lib64/gcc/x86_64-pc-linux-gnu/13.2.1/../../../../include/c++/13.2.1/bits/requires_hosted.h
... /usr/lib64/gcc/x86_64-pc-linux-gnu/13.2.1/../../../../include/c++/13.2.1/x86_64-pc-linux-gnu/bits/c++config.h
.... /usr/lib64/gcc/x86_64-pc-linux-gnu/13.2.1/../../../../include/c++/13.2.1/x86_64-pc-linux-gnu/bits/os_defines.h
..... /usr/include/features.h
...... /usr/include/features-time64.h
....... /usr/include/bits/wordsize.h
....... /usr/include/bits/timesize.h
........ /usr/include/bits/wordsize.h
...... /usr/include/stdc-predef.h
...... /usr/include/sys/cdefs.h
....... /usr/include/bits/wordsize.h
....... /usr/include/bits/long-double.h
...... /usr/include/gnu/stubs.h
....... /usr/include/gnu/stubs-64.h
.... /usr/lib64/gcc/x86_64-pc-linux-gnu/13.2.1/../../../../include/c++/13.2.1/x86_64-pc-linux-gnu/bits/cpu_defines.h
.... /usr/lib64/gcc/x86_64-pc-linux-gnu/13.2.1/../../../../include/c++/13.2.1/pstl/pstl_config.h
TransitiveArray.cpp:5:10: error: no member named 'array' in namespace 'std'
    5 | std::array<int, 5> test_array{};
      | ~~~~~^
TransitiveArray.cpp:5:19: error: expected '(' for function-style cast or type construction
    5 |     std::array<int, 5> test_array{};
 |                ~~~^
TransitiveArray.cpp:5:24: error: use of undeclared identifier 'test_array'
    5 |     std::array<int, 5> test_array{};
      |                        ^
3 errors generated.
```

It seems the problem is [here](https://github.com/llvm/llvm-project/blob/b2417f51dbbd7435eb3aaf203de24de6754da50e/libcxx/include/__format/formatter_integral.h#L26-L29)

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzMVk1v4zYT_jX0hbAgkfqwDj44ToR3gRzeQ-8GP0YyC4pUSWo37qG_vaAsJ3LW3SYpmi5BSDbJ4TzPjMh5mPeqMwBbVNyh4n7FxnC0bvt_9k2y04pbedoiQs8do-Jur5npcFYlaUJQcY_I5hjC4BHdIdIg0nQqHEeeCNsj0mj99fJaD87-CiIg0gQHgEjDSZ5VbZFJzmWV0wI4ZawlKZVAcgllVeSSFSkgUqP0HqW7-Vmm5y4QuYv9PEqoMkKPEjCi-9a6ngVEH5aGygTcM2UQ2bxsWc32GGPsg4w06I45x06I7pUJiOxxgegDDuDD4TxR3aHqHtGL5-r-FbCl073tB6XBY2ti9LTiF9j_RewenLMuQumEwBlNSJLdDK0_ngfElOz1__AvjhmvgvoKuxiCRAzDbdLXfxOMSDN6F3koXuaRoxCINE-b8lDm60GstTLj07ozIyLNjIg0SfL9Y04vIs0lgguDOeFnp5_mlavgEWkc_DYqB_5wtD6ATI4XHJ8G5PZ-M7x5vbCmVd0C3M-BzvqDhFYZ8EtoC2wvW7fAwuheLfzhynVQPZT5tcFNixnNN-ukV7_D2y2ihxsW73dyy8AHKdaDAwntGxafpmxLaP2_SVhb062lHbl-A4Fzqn0Y-VswLVavr7P2U3yqYhhvfaufhW3wQc-vw_VhvnU7012B6C5LEd1hiNd-_GEs7qHn4LBhPUiMSHUuaaTCyky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