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

    <tr>
        <th>Summary</th>
        <td>
            misc-use-internal-linkage should not warn on const/constexpr variables
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang-tidy,
            false-positive
      </td>
    </tr>

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

    <tr>
      <th>Reporter</th>
      <td>
          carlosgalvezp
      </td>
    </tr>
</table>

<pre>
    Example:

https://godbolt.org/z/PqhbTfq6f

`constexpr` implies `const`, and in C++ `const` implies internal linkage. Therefore, the check should not give a warning on const/constexpr variables. Otherwise we add redundant noise to the code by marking the variables `static` or creating an anonymous namespace just for them.

See also:
https://stackoverflow.com/questions/998425/why-does-const-imply-internal-linkage-in-c-when-it-doesnt-in-c
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyEk89yozgQxp9GXLpwgfhnDhw2yXLdrdq8QCM1oFhIRBJ2nKffEnE8npnDXKDqQ_p199cf6L2aDFHHqidWvSS4hdm6TqDT1k-oz_S5JoOV1-7vD1xWTaz4i2UvLLs95xBWHzXeM95PVg5Wh4N1E-P9J-P9v-_z8Dq-1-PjJVZnwhof6GN1rM5ALatW5OFbZ3XG-DOgkaAMPDP-xPjT49f7DWUCOYMatDInnOgArzM5Gq2jSAgzgZhJnMDPdtMSjA0wqTMBwgWdUWYCa-ALy_t7U3BGp3DQ5A_wT5jJXZQnuBCglOBIbkaiCWBslIP9qmMlwXCFBd0pcqN2x8TmfcCgROzeOhCOMMRjaACNNdfFbh4MLuRXFARvmw8wWhcxy-HRvP-IALW390X8vAIfUJzsmdyo7eUg7MJ4_76RD8oaz3jftseSV4z3l_maSks-3adOo6PX9NvP9OZnqkwq0stMJlVhP27CriWyK2RbtJhQlzc8Kyqetcdk7oaqrnhT41Fg3ZZly8e8kVUmiiETDeZFojqe8TJrsibPi7I6Hng51vlYNE0-ipEXOSszWlDpg9bnJUYpUd5v1LVNWzaJxoG03-PKudBopjQoeWWcM_7MOB9Re0pX61VQZ4py9ZK4LrLSYZs8KzOtfPA_6EEFTd2ivEg3T79Z8BidmJk_BCbZnO5--StUmLfhtotY9vZKV2ffSETQPuG-nn3Ic8f_DwAA___PQzFc">