1.. title:: clang-tidy - modernize-unary-static-assert
2
3modernize-unary-static-assert
4=============================
5
6The check diagnoses any ``static_assert`` declaration with an empty string literal
7and provides a fix-it to replace the declaration with a single-argument ``static_assert`` declaration.
8
9The check is only applicable for C++17 and later code.
10
11The following code:
12
13.. code-block:: c++
14
15  void f_textless(int a) {
16    static_assert(sizeof(a) <= 10, "");
17  }
18
19is replaced by:
20
21.. code-block:: c++
22
23  void f_textless(int a) {
24    static_assert(sizeof(a) <= 10);
25  }
26