Modify rule S6013: reword
This commit is contained in:
parent
258f2055da
commit
9474d7d41d
@ -1,8 +1,8 @@
|
|||||||
== Why is this an issue?
|
== 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
|
=== Noncompliant code example
|
||||||
@ -11,9 +11,8 @@
|
|||||||
----
|
----
|
||||||
template <class T>
|
template <class T>
|
||||||
T f(T i) {
|
T f(T i) {
|
||||||
static_assert(std::is_integral<T>::value, ""); // Noncompliant, remove the empty string second argument.
|
static_assert(std::is_integral<T>::value, ""); // Noncompliant: remove the empty string second argument.
|
||||||
// or
|
static_assert(std::is_integral<T>::value, "std::is_integral"); // Noncompliant: remove the redundant second argument.
|
||||||
static_assert(std::is_integral<T>::value, "std::is_integral"); // Noncompliant, remove the redundant second argument.
|
|
||||||
// ...
|
// ...
|
||||||
}
|
}
|
||||||
----
|
----
|
||||||
|
Loading…
x
Reference in New Issue
Block a user