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

    <tr>
        <th>Summary</th>
        <td>
            clang++, libstdc++14, std=c++23 : lots of library code in mainstream libraries fails to build
        </td>
    </tr>

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

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

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

<pre>
    Some repros ; easily reproducible on an archlinux container.

Ex. 1: https://github.com/boostorg/container/issues/282
Ex. 2: https://github.com/martinus/unordered_dense/issues/119
Ex. 3: 
```
#include <nlohmann/json.hpp>

void x(const char* s, int n)
{
  nlohmann::json::parse(s, s + n);
}
```

cause errors such as : 

```
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/tuple:956:36: error: no matching function for call to 'get'
  956 |             return __convertible<decltype(std::get<_Is>(std::declval<_UTuple>()))...>();
 | ^~~~~~~~~~~~~
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/tuple:955:11: note: in instantiation of function template specialization 'std::tuple<const std::basic_string<char> &>::__convertible_from_tuple_like()::(anonymous class)::operator()<0UL>' requested here
  955 |           return []<size_t... _Is>(index_sequence<_Is...>) {
      | ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/tuple:1136:22: note: in instantiation of function template specialization 'std::tuple<const std::basic_string<char> &>::__convertible_from_tuple_like<const std::basic_string<char> &>' requested here
 1136 |         constexpr explicit(!__convertible_from_tuple_like<_UTuple>())
      | ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/bits/stl_map.h:514:38: note: while substituting deduced template arguments into function template 'tuple' [with _UTuple = const key_type &]
  514 | std::tuple<const key_type&>(__k),
      | ^
/usr/include/nlohmann/detail/input/json_sax.hpp:442:66: note: in instantiation of member function 'std::map<std::basic_string<char>, nlohmann::basic_json<>, std::less<void>>::operator[]' requested here
  442 |             object_element = &(ref_stack.back()->m_value.object->operator[](val) = discarded);
      | ^
/usr/include/nlohmann/detail/input/parser.hpp:219:56: note: in instantiation of member function 'nlohmann::detail::json_sax_dom_callback_parser<nlohmann::basic_json<>>::key' requested here
  219 |                         if (JSON_HEDLEY_UNLIKELY(!sax->key(m_lexer.get_string())))
      | ^
/usr/include/nlohmann/detail/input/parser.hpp:98:13: note: in instantiation of function template specialization 'nlohmann::detail::parser<nlohmann::basic_json<>, nlohmann::detail::iterator_input_adapter<const char *>>::sax_parse_internal<nlohmann::detail::json_sax_dom_callback_parser<nlohmann::basic_json<>>>' requested here
   98 |             sax_parse_internal(&sdp);
      | ^
/usr/include/nlohmann/json.hpp:4029:113: note: in instantiation of member function 'nlohmann::detail::parser<nlohmann::basic_json<>, nlohmann::detail::iterator_input_adapter<const char *>>::parse' requested here
 4029 |         parser(detail::input_adapter(std::move(first), std::move(last)), cb, allow_exceptions, ignore_comments).parse(true, result);
      | ^
/usr/include/nlohmann/json.hpp:5138:28: note: in instantiation of function template specialization 'nlohmann::basic_json<>::parse<const char *>' requested here
 5138 |     return nlohmann::json::parse(s, s + n);
 | ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/bits/stl_pair.h:122:5: note: candidate template ignored: could not match 'tuple' against 'basic_string'
  122 |     get(tuple<_Elements...>& __t) noexcept;
 | ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/bits/stl_pair.h:126:5: note: candidate template ignored: could not match 'tuple' against 'basic_string'
  126 |     get(const tuple<_Elements...>& __t) noexcept;
      | ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/bits/stl_pair.h:130:5: note: candidate template ignored: could not match 'tuple' against 'basic_string'
  130 |     get(tuple<_Elements...>&& __t) noexcept;
 | ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/bits/stl_pair.h:134:5: note: candidate template ignored: could not match 'tuple' against 'basic_string'
  134 |     get(const tuple<_Elements...>&& __t) noexcept;
      | ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/bits/stl_pair.h:138:5: note: candidate template ignored: could not match 'array' against 'basic_string'
  138 |     get(array<_Tp, _Nm>&) noexcept;
      | ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/bits/stl_pair.h:142:5: note: candidate template ignored: could not match 'array' against 'basic_string'
  142 |     get(array<_Tp, _Nm>&&) noexcept;
      | ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/bits/stl_pair.h:146:5: note: candidate template ignored: could not match 'array' against 'basic_string'
  146 |     get(const array<_Tp, _Nm>&) noexcept;
 | ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/bits/stl_pair.h:150:5: note: candidate template ignored: could not match 'array' against 'basic_string'
  150 |     get(const array<_Tp, _Nm>&&) noexcept;
 | ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/bits/stl_pair.h:1250:5: note: candidate template ignored: could not match 'pair' against 'basic_string'
 1250 |     get(pair<_Tp1, _Tp2>& __in) noexcept
      | ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/bits/stl_pair.h:1255:5: note: candidate template ignored: could not match 'pair' against 'basic_string'
 1255 |     get(pair<_Tp1, _Tp2>&& __in) noexcept
 | ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/bits/stl_pair.h:1260:5: note: candidate template ignored: could not match 'pair' against 'basic_string'
 1260 |     get(const pair<_Tp1, _Tp2>& __in) noexcept
 | ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/bits/stl_pair.h:1265:5: note: candidate template ignored: could not match 'pair' against 'basic_string'
 1265 |     get(const pair<_Tp1, _Tp2>&& __in) noexcept
 | ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/bits/ranges_util.h:444:5: note: candidate template ignored: could not match 'subrange' against 'basic_string'
  444 |     get(const subrange<_It, _Sent, _Kind>& __r)
 | ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/bits/ranges_util.h:455:5: note: candidate template ignored: could not match 'subrange' against 'basic_string'
  455 |     get(subrange<_It, _Sent, _Kind>&& __r)
 | ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/bits/stl_pair.h:1272:5: note: candidate template ignored: invalid explicitly-specified argument for template parameter '_Tp'
 1272 |     get(pair<_Tp, _Up>& __p) noexcept
 | ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/bits/stl_pair.h:1277:5: note: candidate template ignored: invalid explicitly-specified argument for template parameter '_Tp'
 1277 |     get(const pair<_Tp, _Up>& __p) noexcept
      | ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/bits/stl_pair.h:1282:5: note: candidate template ignored: invalid explicitly-specified argument for template parameter '_Tp'
 1282 |     get(pair<_Tp, _Up>&& __p) noexcept
      | ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/bits/stl_pair.h:1287:5: note: candidate template ignored: invalid explicitly-specified argument for template parameter '_Tp'
 1287 |     get(const pair<_Tp, _Up>&& __p) noexcept
      | ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/bits/stl_pair.h:1292:5: note: candidate template ignored: invalid explicitly-specified argument for template parameter '_Tp'
 1292 |     get(pair<_Up, _Tp>& __p) noexcept
 | ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/bits/stl_pair.h:1297:5: note: candidate template ignored: invalid explicitly-specified argument for template parameter '_Tp'
 1297 |     get(const pair<_Up, _Tp>& __p) noexcept
      | ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/bits/stl_pair.h:1302:5: note: candidate template ignored: invalid explicitly-specified argument for template parameter '_Tp'
 1302 |     get(pair<_Up, _Tp>&& __p) noexcept
      | ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/bits/stl_pair.h:1307:5: note: candidate template ignored: invalid explicitly-specified argument for template parameter '_Tp'
 1307 |     get(const pair<_Up, _Tp>&& __p) noexcept
      |     ^
1 warning and 1 error generated.

```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzUmk9zm7z2x1-NvNGEAYEBL7xwHHt-_T2d3kXbxbNiBBzbaoTElUTqPIv72u9IYPwnTmM3vfGf8bguSAfx-X6lcxRDtWZLATBGw3s0fBjQxqykGv8ogINioAa5LJ_HX2UFWEGtpMYovMdANePP7ZGyKVjOAUuBqcBUFSvORLPGhRSGMgHKQ_4D8ift52zt4QCFE7wyptYonCAyR2S-ZGbV5F4hK0TmuZTaSLVEZN4HQWTOtG5AIzInKdkGI28Eq6gyTDS2XyOkKkFBmZUgNOyGDILRNmRoQ3aDjv3u3f6XhEwUvCkBo3AquFxVVAhE5j-0FN6qrlE4273bJ8lKvEYkLaTQBhcrqhCZYI3IFDNhsECkuy5K7tsvGPdhwwkKJzZy-62myg46db01RuS-7R_eb0I8HB-0-yxoowGDUlJprJtihanVsr_R47c7b7RFnzN7k56HyJyzPI4s5KJAZL5O4yyO7urizol-txSNpRl5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