[BUG] use of const shared_ptr return type is ineffective/unneeded
stuart-byma opened this issue · 1 comments
Prerequisites
- Put an X between the brackets on this line if you have checked that your issue isn't already filed: https://github.com/search?l=&q=repo%3Aetr%2Flibhttpserver&type=Issues
Description
This is a sort-of bug and really a minor issue.
Using const qualifier on the shared_ptr return type is ineffective and unneeded. clang-tidy points out:
warning: return type 'const std::shared_ptrhttpserver::http_response' is 'const'-qualified at the top level, which may reduce code readability without improving const correctness [readability-const-return-type]
std::shared_ptrhttpserver::http_response const
for more details.
Steps to Reproduce
To reproduce, run clang-tidy 14 or 15 on the code base, or any code that uses a const std::shared_ptr<http_response> return type.
Expected behavior: [What you expect to happen]
No issues found (at least not this one, there maybe other things that clang-tidy flags).
Actual behavior: [What actually happens]
clang-tidy reports the issue.
Reproduces how often: [What percentage of the time does it reproduce?]
100%
Versions
clang-tidy 14 or 15, possibly earlier versions as well.
Additional Information
None
It does make sense - I just approved the PR. Thanks a lot for your help.