Skip to content

Commit 040b141

Browse files
authored
Clarify ES.48 enforcement rule for void cast of [[nodiscard]] (#1588)
1 parent 1ca5545 commit 040b141

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

CppCoreGuidelines.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11707,7 +11707,7 @@ Casts are widely (mis) used. Modern C++ has rules and constructs that eliminate
1170711707

1170811708
##### Enforcement
1170911709

11710-
* Force the elimination of C-style casts, except on a function with a `[[nodiscard]]` return.
11710+
* Force the elimination of C-style casts, except when casting a `[[nodiscard]]` function return value to void.
1171111711
* Warn if there are many functional style casts (there is an obvious problem in quantifying 'many').
1171211712
* The [type profile](#Pro-type-reinterpretcast) bans `reinterpret_cast`.
1171311713
* Warn against [identity casts](#Pro-type-identitycast) between pointer types, where the source and target types are the same (#Pro-type-identitycast).

0 commit comments

Comments
 (0)