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

    <tr>
        <th>Summary</th>
        <td>
            Unexpected error when using libc++ (call to deleted function 'from_chars')
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

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

<pre>
    ### Code
<details>

Compile with `clang++ -std=c++17 -stdlib=libc++`

```cpp
#include <charconv>
#include <string>
#include <stdexcept>

template<typename T>
T decode_num(std::string_view s) {
    T r;
    auto ec = std::from_chars(s.data(), s.data() + s.size(), r);
    if (ec.ec == std::errc())
        return r;
    else
 throw std::runtime_error("decode_num");
}

int main() {
 const char fs[]{ "0.87" };
    float r = decode_num<float>(fs);
 return 0;
}
```
</details>

### Error:
<details>

```
t1.cpp:8:15: error: call to deleted function 'from_chars'
    auto ec = std::from_chars(s.data(), s.data() + s.size(), r);
              ^~~~~~~~~~~~~~~
t1.cpp:17:15: note: in instantiation of function template specialization 'decode_num<float>' requested here
    float r = decode_num<float>(fs);
 ^
/usr/bin/../include/c++/v1/charconv:113:19: note: candidate function has been explicitly deleted
from_chars_result from_chars(const char*, const char*, bool, int = 10) = delete;
 ^
/usr/bin/../include/c++/v1/charconv:588:1: note: candidate template ignored: requirement 'is_integral<float>::value' was not satisfied [with _Tp = float]
from_chars(const char* __first, const char* __last, _Tp& __value)
^
/usr/bin/../include/c++/v1/charconv:595:1: note: candidate function template not viable: requires 4 arguments, but 3 were provided
from_chars(const char* __first, const char* __last, _Tp& __value, int __base)
^
1 error generated.
```
</details>

### Versions:
libc++: 14.0.6

### Other information
Error does **NOT** occur when:
- compile with gcc or msvc
- without `-stdlib=libc++`
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy8Vs2uozgTfRpnU7oI7BDCIgt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