From 040b141acf729e1f7d83f5740043ab98adba21dc Mon Sep 17 00:00:00 2001 From: shaneasd Date: Fri, 27 Mar 2020 02:47:19 +0800 Subject: [PATCH] Clarify ES.48 enforcement rule for void cast of [[nodiscard]] (#1588) --- CppCoreGuidelines.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index 502e730..2b4e6d4 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -11707,7 +11707,7 @@ Casts are widely (mis) used. Modern C++ has rules and constructs that eliminate ##### Enforcement -* Force the elimination of C-style casts, except on a function with a `[[nodiscard]]` return. +* Force the elimination of C-style casts, except when casting a `[[nodiscard]]` function return value to void. * Warn if there are many functional style casts (there is an obvious problem in quantifying 'many'). * The [type profile](#Pro-type-reinterpretcast) bans `reinterpret_cast`. * Warn against [identity casts](#Pro-type-identitycast) between pointer types, where the source and target types are the same (#Pro-type-identitycast).