| 1 |
.. title:: clang-tidy - modernize-use-using |
| 2 |
|
| 3 |
modernize-use-using |
| 4 |
=================== |
| 5 |
|
| 6 |
The check converts the usage of ``typedef`` with ``using`` keyword. |
| 7 |
|
| 8 |
Before: |
| 9 |
|
| 10 |
.. code-block:: c++ |
| 11 |
|
| 12 |
typedef int variable; |
| 13 |
|
| 14 |
class Class{}; |
| 15 |
typedef void (Class::* MyPtrType)() const; |
| 16 |
|
| 17 |
typedef struct { int a; } R_t, *R_p; |
| 18 |
|
| 19 |
After: |
| 20 |
|
| 21 |
.. code-block:: c++ |
| 22 |
|
| 23 |
using variable = int; |
| 24 |
|
| 25 |
class Class{}; |
| 26 |
using MyPtrType = void (Class::*)() const; |
| 27 |
|
| 28 |
using R_t = struct { int a; }; |
| 29 |
using R_p = R_t*; |
| 30 |
|
| 31 |
This check requires using C++11 or higher to run. |
| 32 |
|
| 33 |
Options |
| 34 |
------- |
| 35 |
|
| 36 |
.. option:: IgnoreMacros |
| 37 |
|
| 38 |
If set to `true`, the check will not give warnings inside macros. Default |
| 39 |
is `true`. |