tarantool / checkpatch

Checkpatch for Tarantool
GNU General Public License v2.0
2 stars 2 forks source link

C++ template parameter is classified as a statement. #66

Closed mkostoevr closed 1 year ago

mkostoevr commented 1 year ago
  1. In C++ we can specify typed template paratemer like this:
    template<bool flag>
  2. In order to specify the default value for the parameter this syntax is used:
    template<bool flag = false>
  3. The template parameter may be introduced in a new line, like so:
    template<bool flag_a = false,
            bool flag_b = false>

So, checkpatch classifies the typed default-initialized template parameter, introduced in the new line (as in example 3) as a regular statement, and thus, we have the following diagnostic

Commit 68c13373ac0c ("box: example for checkpatch, to be dropped")
------------------------------------------------------------------
ERROR:TABSTOP: Statements should start on a tabstop
#20: FILE: src/box/tuple_compare.cc:597:
+    bool flag_b = false>
total: 1 errors, 15 lines checked
Commit 68c13373ac0c ("box: example for checkpatch, to be dropped") has style problems, please review.

This is a false-positive.

mkostoevr commented 1 year ago

Thanks!