[clang-tidy] modernize-use-string-view may result in uncompiled code
Open
Beginner friendly
clang-tidy
documentation
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
```c++
#include
#include
#include
std::string foo() {
return "foo";
}
int main() {
return strlen(foo().c_str());
}
```
`std::string_view` doesn't have `c_str` method.
Since it's impossible to fix, it should be reflected as known limitation
Contributor guide
Research direction
Start by reading the clang-tidy modernize-use-string-view documentation and checking how the supplied C++ example is transformed. Document the c_str limitation as a known limitation, with the example showing that the transformed code does not compile.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- tooling
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 70/100