Skip to content

Commit 1894380

Browse files
authored
Merge pull request #737 from rianquinn/patch-1
Update C.128 to remove override from destructors
2 parents a75e33a + 8be1869 commit 1894380

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

CppCoreGuidelines.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6103,7 +6103,7 @@ Readability.
61036103
Detection of mistakes.
61046104
Writing explicit `virtual`, `override`, or `final` is self-documenting and enables the compiler to catch mismatch of types and/or names between base and derived classes. However, writing more than one of these three is both redundant and a potential source of errors.
61056105

6106-
Use `virtual` only when declaring a new virtual function. Use `override` only when declaring an overrider. Use `final` only when declaring an final overrider.
6106+
Use `virtual` only when declaring a new virtual function. Use `override` only when declaring an overrider. Use `final` only when declaring an final overrider. If a base class destructor is declared `virtual`, derived class destructors should neither be declared `virtual` nor `override`.
61076107

61086108
##### Example, bad
61096109

0 commit comments

Comments
 (0)