<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/61454>61454</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            clang-tidy feature request: C++ Core Guidelines "ES.23: Prefer the `{}`-initializer syntax" (avoid `()` initialization)
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          N-Dekker
      </td>
    </tr>
</table>

<pre>
    C++ Core Guidelines, September 23, 2022, item [ES.23: Prefer the `{}`-initializer syntax](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Res-list) says:

> Prefer {}. The rules for {} initialization are simpler, more general, less ambiguous, and safer than for other forms of initialization.

> Use = only when you are sure that there can be no narrowing conversions. For built-in arithmetic types, use = only with auto.
>
> Avoid () initialization, which allows parsing ambiguities.

So for example, when declaring an `m` x `n` matrix object (assuming a `Matrix::Matrix(int m, int n)` constructor):

    Matrix oldStyleMatrix(m, n);  // Old style: initialization using parentheses
 Matrix newStyleMatrix{m, n};  // New style: initialization using curly braces.

The new style (using curly braces) appears preferable, according to this guideline. Would it be possible to add a clang-tidy check, to warn against using the old style, as well as the ability to convert code to the new style (using the option `-fix`)?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycVE2P4zYM_TXKhYjhyPk8-DCZbHrabdFp0bNsM7E6suSK1GTSX19Qznx2iwJ7iRWJenx6JJ8hsmePWKvVXq0OM5O4D7H-Nj_g4yPGWRO6a32v9F7pPdyHiPBTsh0665GUvocHHBmHBiPoSv7rUmv5WsYB1Gr_5aHQlaru4JeIJ4zAPYJal2qzV5uDWpdz6y1b4-zfGIGuns2zWh2U3vbMI6nqTumj0kdLoR3H4my5T01hg9LH-3EUPu_pfG-v-hVp7iyx0jsgc82Y5UGVL7_VlxduE6kCfusRYnJIcAovu_DK07ANHkxEI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