Skip to content

[BUG] use of const shared_ptr return type is ineffective/unneeded #284

@stuart-byma

Description

@stuart-byma

Prerequisites

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

See https://stackoverflow.com/questions/63972019/understanding-const-at-top-level-which-may-reduce-code-readability-without-i

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

Metadata

Metadata

Assignees

Labels

bugConfirmed bugs or reports that are very likely to be bugs.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions