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

    <tr>
        <th>Summary</th>
        <td>
            [libc++] Should `std::tuple_size<const int>` be a complete type?
        </td>
    </tr>

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

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

    <tr>
      <th>Reporter</th>
      <td>
          frederick-vs-ja
      </td>
    </tr>
</table>

<pre>
    The following code snippet is currently showing implementation divergence ([Godbolt link](https://godbolt.org/z/P8oWqf5sT)). MSVC STL's `std::tuple_size<const int>` is a complete type, while libstdc++'s and libc++'s are not.
```C++
#include <tuple>

// constexpr auto foo = sizeof(std::tuple_size<int>);    // Correctly rejected.
constexpr auto bar = sizeof(std::tuple_size<const int>); // Should be well-formed?
```

It seems that MSVC STL's behavior is justified by [[contents]/1](https://eel.is/c++draft/contents#1) and [[tuple.syn]](https://eel.is/c++draft/tuple.syn), given that only the primary templates of `std::tuple_size` and `std::tuple_element` are marked `// not defined`.

I'm not sure whether this should be considered as a bug. Perhaps an LWG issue is wanted.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVF2L4zYU_TXyyyVGlvyRPPhhktRLYQsLM3Qfi2xdx5qRJVeSk2Z_fZHtZWdmtzAFQ4h0P87ROfcK79XFINakOJLinIg5DNbVvUOJTnUvu6vfPYuktfJePw0IvdXa3pS5QGclgjdqmjCA8tDNzqEJ-g5-WCPUOGkc0QQRlDUg1RXdBU2HQNieFMdPVrZWB9DKvJDiTNh-CGHyhD8Q1hDWXNb71LoLYc03wpove_v1777wT4QdCDuk8Mfjnyd4fPpMWOWBlNQHGdP5Q5gnjX959Q0JP3XW-ADKBMJ_IyWNaAV0NsILCOE-IWEnuA1KI2jV-iA7wo7LV3kQRsbTN0cOwdiQEnom9IGUdP1OW8h6yrgynZ4lAuGnBU9sv95tEZElLOjwn8mBmIOF3log_AwRu-0J2_-a08aGHQg_AgBsxU7WOeyiCg6fsQsoN5DvurTCfaTLm5dbe22NHgc7awktwg213vXWjSgJb949yWu-vwfwiKOHMIjwVroWB3FV1kVpnmcfVK9QQnuHxZbHzpqAJvjFJU32K7Mg6lR5wppNJ-lEH-Lf76mMZ4QdFjXXogvR1N9NLPc_Kv7IiyY8wUVd0aycrNF3CAPC5NQo3B0CjpMWAT3Y_r_8WdIV1E-3uE7PEuAQRuFecInbJDA2gMReGZSkpOmbpyasGpcAPzuE24BhQAdhUD6O56ZcVFdJdChBxJFo50sKX9ANYoq2h89fP4HyfsYoy02Y6KZE1lwe-EEkWGcVLYqSl7RIhprnUhx42-Z5R9ui6zLR9binuC-qKuNVlqiaUZbTLNvTKqe0SCXtc9aVfS4rzmWZkZziKJROtb6OceqTpXld7Yu8SrRoUftlTzH2eh5Z3Fuujkm7dr54klOtfPA_ygQV9LLhXqUV5-8W_vDaaPGntcGbZHa6fre3VBjmNu3sSFgTQWw_u8nZOJOENQux6K2F278BAAD__xbmuaw">