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

Use the C++17 standard [[nodiscard]] attribute directly #8036

Merged
merged 3 commits into from
Nov 21, 2023

Conversation

thomasspriggs
Copy link
Contributor

@thomasspriggs thomasspriggs commented Nov 14, 2023

As we now require C++17 support, the [[nodiscard]] attribute should be required to be supported across all platforms. Using it directly makes it more straight forward for new maintainers with pre-existing C++17 knowledge to read our code base without learning NODISCARD, which is specific to our codebase.

  • Each commit message has a non-empty body, explaining why the change was made.
  • Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • White-space or formatting changes outside the feature-related changed lines are in commits of their own.

@thomasspriggs thomasspriggs self-assigned this Nov 14, 2023
@thomasspriggs thomasspriggs added the Version 6 Pull requests and issues requiring a major version bump label Nov 14, 2023
Copy link

codecov bot commented Nov 14, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (ea77c96) 79.09% compared to head (0857208) 79.09%.
Report is 2 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #8036   +/-   ##
========================================
  Coverage    79.09%   79.09%           
========================================
  Files         1699     1699           
  Lines       196508   196508           
========================================
  Hits        155430   155430           
  Misses       41078    41078           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

As we now require `C++17` support, the `[[nodiscard]]` attribute is
required to be supported across all platforms.
This makes it more straight forward for new maintainers with
pre-existing C++17 knowledge to read our code base without learning
`NODISCARD`, which is specific to our codebase.
Because it is no longer needed.
@thomasspriggs
Copy link
Contributor Author

I'd like to check how nodiscard issues are reported across each of the platforms we support, before I move this PR out of draft and merge it. I have raised #8038 for this purpose.

@thomasspriggs
Copy link
Contributor Author

Looks like the error/warning reporting is the same before and after this PR. Therefore I am now happy for this to be merged.

@thomasspriggs thomasspriggs merged commit 44e53c8 into diffblue:develop Nov 21, 2023
@thomasspriggs thomasspriggs deleted the tas/nonodiscard branch November 21, 2023 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Version 6 Pull requests and issues requiring a major version bump
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants