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

    <tr>
        <th>Summary</th>
        <td>
            Enhancement for clang-tidy readability-redundant-string-cstr check 
        </td>
    </tr>

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

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

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

<pre>
    The readability-redundant-string-cstr warning should also fire when constructing string_view and filesystem::path.


#include <string>
#include <filesystem>

// readability-redundant-string-cstr

int
main()
{
  std::string s ("foo");

  // This does warn
  std::string t (s.c_str());

  // These should warn, but do not.
  std::string_view u (s.c_str());
  std::filesystem::path v (s.c_str());

  (void)t;
  (void)u;
  (void)v;

  return 0;
}
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyNks1u4yAQx5_GvqBYNrZj-8ChabJP0HuFYRzYJRDBkChvv9hulVTbdishvmbmN3-YGZ28sRcFxAOXfNRG423jQUYrucVNQK_tcSPSSq7c23QgQbloJOEmODJpD-SqwBLhbHKKAheXJez1ouFKuJXJzUC4BYRTVj-lceaoiqzcZ-XTh5nW2goTJZCsfl4hWX34zPhIPHxk_Erj_895jNEW182Ja5vRPqPDm7nbrRuSniRX7SuDBLI40sm5NM8R9e6RScibkhelA5EOwvKBX-FwxoVCvM7SVgXfISHAex0WKn0mY8SUhliHxRdJ1nrEbzM9BH1WNHL5oc7-4rRMJnwg32_jp7eXfzgeMHpLyruh2-fAqu126Frab5tcsloO9cBz1GiAHaziVsAJLJLJeSIMT_VGLW8_aHChQPwhefSGKcRzmJ-9fPhRo4pjIdwpHYy5vC-bs3e_QWA66hAihLRpB9q2uWKyldXUQTP1vJq25bauBwmlHKCDceygyg0fwQSWtbvUPzYVZkHMvdTuc81oSWlV0YGWVUObYuj7epogzbzjrWiypoTUraaYdRTOH3PPFkljPIZkNDpguBt5CPpoAZZ0ic8jKueZjTZR8iUzW5T_BZTsOvQ">