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

    <tr>
        <th>Summary</th>
        <td>
            [clang-tidy] readability-magic-numbers should allow magic numbers in type aliases.
        </td>
    </tr>

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

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

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

<pre>
    I often use the following construct to make sure that I use the correct types throughout my code:
```c++
using UserName_t = ns::custom_string_type<25>;
```
this triggers a magic numbers warning since the `25` is a magic number, but I'm using the type alias to prevent having magic numbers. 
Changing the code to:
```c++
static constexpr USER_NAME_LENGTH = 25;
using UserName_t = ns::custom_string_type<USER_NAME_LENGTH>;
```
isn't really an improvement unless you need to access the value somewhere else IMO.

I would like the behavior to change so that magic numbers in type-aliases do not trigger the warning.

I would like to propose a patch myself, but I would like to know how I should implement and propose this:
 1. the default behavior should change (potentially surprising users who are relying on the current warning?).
 2. a flag should be added i.e. `IgnoreTypeAliases` which will default to false.

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycVF2vozYQ_TXOyyiIGPL1wEPuR9pI3Vup3X2OjBnAvcZG9jgp_76y4Wa1V9VWqoQSYcZnzpxzbOG96gxixbZPbPuyEoF666pWW6eE6cNQa0ur2jZTdQHbEhoIHoF6hNZqbe_KdCCt8eSCJCALg3hH8MHFIkFwedRL6xzGmmlED9Q7G7reBoJhAmkbZMWJ5S8sP7FdPj-S8af4pNXgY6tvHt2bGPBKwIoXMD7uKk4yeLLD1ZNTprvGDqx45ltWvLLi6RPq_Eq98kBOdR06DwIG0SkJJgx1fL8LZ2I7r4yc2bNdzrdsl4P6XM34M9SB4ML4foCZZtwRWYDQSvgoy-jwhoagF7dY8EO7DGZOz70w3cf2KAmQ_Q9VPAlScnYA_x4dfPvz9Y_r2-nL6_W317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