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

Enforce the use of override #78

Merged
merged 2 commits into from
Mar 18, 2024
Merged

Enforce the use of override #78

merged 2 commits into from
Mar 18, 2024

Conversation

dk949
Copy link
Contributor

@dk949 dk949 commented Jan 17, 2024

-Wsuggest-override has been available on GCC since 5.1. It warns if a member function overrides a base class function, but is not marked override (or final since GCC 9.2).

It appears that Visual Studio has a similar warning, but not being a Visual Studio user, I can't figure out how to enable it.

Since the template says it should work with Clang 6, and this warning was introduced in Clang in version 11.0.0, I only enabled it for GCC.

This warning is available on GCC since 5.1 and Clang since 11.0.0.

Since GCC 9.2 it also does not warn if 'final' is used instead of
'override'. This was the case in Clang since the warning was introduced.
I did not realise Clang 6 was the earliest supported Clang version.
@codecov-commenter
Copy link

codecov-commenter commented Jan 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (d19d892) 24.70% compared to head (5befd22) 24.70%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #78   +/-   ##
=======================================
  Coverage   24.70%   24.70%           
=======================================
  Files           6        6           
  Lines         251      251           
  Branches      142      143    +1     
=======================================
  Hits           62       62           
  Misses        181      181           
  Partials        8        8           
Flag Coverage Δ
Linux 14.89% <ø> (-1.54%) ⬇️
Windows 21.42% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@lefticus lefticus merged commit 759d718 into cpp-best-practices:main Mar 18, 2024
20 of 31 checks passed
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.

None yet

3 participants