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

    <tr>
        <th>Summary</th>
        <td>
            Enhancement for clang-tidy readability-redundant-string-cstr check #59255 (more clear code , good readability)
        </td>
    </tr>

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

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

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

<pre>
    The issue in the code was that it used the `c_str()` function unnecessarily when creating std::string_view and std::filesystem::path  objects. The  c_str() function is typically used to obtain a C-style string from a  std::string, but in this context, it wasn't required. This could make the code less clear and may confuse readers, as it suggests that the code is dealing with C-style strings instead of C++ string data types.

i think it should be like this :

#include
#include
int main()
{
std::string s("foo");
std::string t(s);
std::string_view u(s);
std::filesystem::path v(s);
(void)t;
(void)u;
(void)v;
return 0;
}
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx8U8uSozgQ_BpxqbADC-PHgUM_tr9g7xNCKqCmheRVldzL328Ie8cdHT1zAVRKqjJTKcNMY0DsVPus2tfKZJli6hziRSiZnzGZqo9u6f6eEIg5I1AAmRBsdAgfhkEmI0ACmdGtO-pQ2x8sSemT0md1qGHIwQrFADkEtMhsEvkFPiYMYBMaoTACi1PNk2qeWBKF8ceV8ANMcI-NgTzywoLzbX0xMgHE_ida4S0UivBp8mMsMchyIWu8X-48I8ReDAUw8LJhWTzCbS4MKc5g4CsfpV-gz3KTTww2BsF_pZRJihFB6aNAwn8yJXSFzorK3sFs3vFhmkdmsB5NWuXNZinNhswICY3DxKWp4dKX8zgiy93lXy2IwaHxhe4HyfRFAgMFFjQO4gAvSj8r_fy_OmfEFDOQt6p-VfXT7UlFVHhfR04r5x7B00qbGIoRn9BKNxSszw6_X1MQmA2FewJumOPz7eOLr8ArSg8xKq0LvPkNUJQ-8R8At8Tk36K-jc_1K1zp0zWSU_os39TyN7Xrr1pCySlA_QAdXyvXNe7cnE2F3e642zWH9rhvqqnrnWvO1h3aYz-4ejA7ezq2J7M7Hq3b73GoqNO13teNbnc7rbXentC5tsfWHU497lur9jXOhvzW--u8jWms1hvanQ77c11506Pn9WJrbb0J40bILcXk9rVKXflp0-eR1b72xMKPNkLisfsrTCZYnDEIDDHBo8eaU9OTJ1k2CV0OzgTZ3I5hY1kS2AntOyjdtGfdtqD0aY4J77FfM1xCPsboPjdT-lzl5LtJ5MLllPSb0m8jyZT7rY2z0m-F5P21uaRY7r7Sb6twVvpt1f5fAAAA__8yjYyk">