From 9474d7d41d0989558bdeb526ffe0b08b4feae855 Mon Sep 17 00:00:00 2001 From: Amelie Renard Date: Mon, 2 Oct 2023 16:54:52 +0200 Subject: [PATCH] Modify rule S6013: reword --- rules/S6013/cfamily/rule.adoc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/rules/S6013/cfamily/rule.adoc b/rules/S6013/cfamily/rule.adoc index 745c90fb29..fb4350dff9 100644 --- a/rules/S6013/cfamily/rule.adoc +++ b/rules/S6013/cfamily/rule.adoc @@ -1,8 +1,8 @@ == Why is this an issue? -{cpp}11 version of the standard introduced ``++static_assert(expr, message)++`` to check that the compile-time constant expression ``++expr++`` is true. +{cpp}11 introduced ``++static_assert(expr, message)++`` to check that the compile-time constant expression ``++expr++`` is true. -{cpp}17 version of the standard has made the second argument ``++message++`` optional. This rule flags occurrences of ``++std::static_assert++`` where the second argument message is empty or a substring of ``++expr++``. +{cpp}17 has made the second argument ``++message++`` optional. This rule flags occurrences of ``++std::static_assert++`` where the second argument message is empty or a substring of ``++expr++``. === Noncompliant code example @@ -11,9 +11,8 @@ ---- template T f(T i) { - static_assert(std::is_integral::value, ""); // Noncompliant, remove the empty string second argument. - // or - static_assert(std::is_integral::value, "std::is_integral"); // Noncompliant, remove the redundant second argument. + static_assert(std::is_integral::value, ""); // Noncompliant: remove the empty string second argument. + static_assert(std::is_integral::value, "std::is_integral"); // Noncompliant: remove the redundant second argument. // ... } ----