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

    <tr>
        <th>Summary</th>
        <td>
            Remove `operator T` from libc's `cpp::expected`
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            code-cleanup,
            libc
      </td>
    </tr>

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

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

<pre>
    The libc's equivalent of `std::expected` has a non-standard and non-explicit `operator T`. This meant that some incorrect code patterns have either stayed or crept into the libc source. An example can be found here: https://github.com/llvm/llvm-project/blob/main/libc/test/src/__support/File/platform_file_test.cpp#L20.

This issue to address two things:
1. Remove `operator T` from `cpp::expected`
2. Cleanup the libc source code which uses `operator T` from `cpp::expected`.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUk09vpDwMxj9NuFhFEIaZcuAwbytO72nV-8hJzCSrkGQTM22__Qpm_0hd7Uq9gHBs4-f3OFiKuwaiUfT_if65wpVtzGNxN9QWg8lYqWjexxdL4J3SQp4K0LfV3dBTYIgziGNT2IjuLLozvSXSTEYcG7BYACHE8FAYg8FsAIPZA_SWvNOOt9qYKCPHDC_i2NTwYl2BhTAwsEWGEhcCF3TMmTSDjoYgITPlUMDijYAcW8pQGN_JQMygMyUGFzgC_xgbSlyzphrOAegNl-QJNAZQBHNcgwFLmUR3BsucyqZFTkJOV8d2VbWOi5CT97efr4eU41fSLOSkfFRCTgu6sB3uiCamsp2VvH1cLmVNKeYtMjlPQk7JI88xL5fZebps2bVOScjuf9nUonkWzfn-3Gm4UlYCjoDGZCoF-HVT5sJ1n3RPbGv4Qku80R9IYc5x2aLbHz6adC-WNTx5wrCmj8DuvF-t0xbWQuVz3evKjJ0ZugErGtvj40H23ak9VXakFlU3mMEM6jS3fY-qa7peH3qj1QHnoXKjbGTX9O2xPbZ929WzmtHMqIYDzafm8CgODS3ofL35Ucd8rXZM41GeusfKoyJf9qWWctPwoO8ChZRCPgkp707JbefzuHuq1msRh8a7wuV3V3bsafwn21_34i8YqjX78dOLtcspQk67ou8BAAD__43CMgQ">