Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #12974 FN functionConst with std::as_const() #6654

Merged
merged 5 commits into from
Aug 2, 2024

Conversation

chrchr-github
Copy link
Collaborator

No description provided.

@chrchr-github
Copy link
Collaborator Author

chrchr-github commented Aug 1, 2024

@chrchr-github chrchr-github marked this pull request as ready for review August 1, 2024 12:56
@pfultz2
Copy link
Contributor

pfultz2 commented Aug 1, 2024

std::move is not pure in e.g. MSVC STL or libstdc++:

It is marked with constexpr which makes it pure(since constexpr functions cannot rely on global state). Furthermore the implementation of std::move which is just a static_cast is pure as well.

Is there an issue with it being pure that you see?

@chrchr-github
Copy link
Collaborator Author

Is there an issue with it being pure that you see?

Yes: https://github.com/danmar/cppcheck/actions/runs/10196381651/job/28207045014
It is probably easier to treat std::move as if it modifies its argument as opposed to tracking what happens to its return value.

@chrchr-github chrchr-github merged commit ef487ad into danmar:main Aug 2, 2024
63 checks passed
@chrchr-github chrchr-github deleted the chr_12974 branch August 2, 2024 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants