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