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

    <tr>
        <th>Summary</th>
        <td>
            [clang] slow compile time
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang
      </td>
    </tr>

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

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

<pre>
    Hi, I noticed slow compiler time with the below code. This program takes a over 1 minute to compile using clang, but ~2.5 seconds using gcc.

```
> time clang++ -std=c++23 -o array_test.o -c array_test.cpp
clang++ -std=c++23 -o array_test.o -c array_test.cpp  75.08s user 0.20s system 99% cpu 1:15.50 total
> time g++ -std=c++23 -o array_test.o -c array_test.cpp
g++ -std=c++23 -o array_test.o -c array_test.cpp  2.20s user 0.19s system 97% cpu 2.446 total
```

```
#include <array>

namespace detail
{
    template <typename T, std::size_t ... Is>
    constexpr std::array<T, sizeof...(Is)>
    create_array(T value, std::index_sequence<Is...>)
    {
        return {{(static_cast<void>(Is), value)...}};
    }
}

//create array with all elements initialized to a specific value
template <typename T, std::size_t N>
constexpr std::array<T, N> create_initialized_array(const T& value)
{
    return detail::create_array(value, std::make_index_sequence<N>());
}



struct Test 
{
 static auto constexpr ARR_SZ = 65535;
    Test() : array_{create_initialized_array<int,ARR_SZ>(-1)} {}
 std::array<int,ARR_SZ> array_;
};

Test g_test;
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykVc2OqzgTfRpnUwrCdoCwYJGEbn29uYv79Wo2kWPqJp5rMIOL_lvMs49sSDrJ3NGM1BFyMHadc-qUf5T35tghVizbsqxeqJFObqjUq3PN2-Lgmvfqf4aJHTxB58hobMBb9wratb2xOACZFuHV0AnohHDAabDBBJ5PxkM_uOOgWiD1Ez0ocC84AIfWdCMhkDsDwehNdwRtVXcMdIeR4E-RZOBRu67x8_hR64SlNUs3c5un8z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