Skip to content

Commit 9b3f20e

Browse files
authored
F.6 noexcept Issue #2220 (#2264)
* F.6 noexcept * add overriders to isocpp.dic
1 parent 0459ef4 commit 9b3f20e

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CppCoreGuidelines.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -2740,9 +2740,13 @@ low-level functions.
27402740
Destructors, `swap` functions, move operations, and default constructors should never throw.
27412741
See also [C.44](#Rc-default00).
27422742

2743+
##### Note
2744+
2745+
Care must be taken on base virtual functions and functions part of a public interface because declaring a function `noexcept` is establishing a guarantee that all current and future implementations must abide by. For virtual function, all overriders must also be `noexcept` and removing `noexcept` from a function could break calling functions.
2746+
27432747
##### Enforcement
27442748

2745-
* Flag functions that are not `noexcept`, yet cannot throw.
2749+
* (hard) Flag low-level functions that are not `noexcept`, yet cannot throw.
27462750
* Flag throwing `swap`, `move`, destructors, and default constructors.
27472751

27482752
### <a name="Rf-smart"></a>F.7: For general use, take `T*` or `T&` arguments rather than smart pointers

scripts/hunspell/isocpp.dic

+1
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,7 @@ overabstract
400400
overconstrain
401401
overconstrained
402402
overridable
403+
overriders
403404
p1
404405
p2
405406
p3

0 commit comments

Comments
 (0)