brintos

brintos / llvm-project-archived public Read only

0
0
Text · 952 B · 9eedf20 Raw
53 lines · plain
1.. title:: clang-tidy - modernize-use-using2 3modernize-use-using4===================5 6The check converts the usage of ``typedef`` with ``using`` keyword.7 8Before: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 19After: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 31The checker ignores `typedef` within `extern "C" { ... }` blocks.32 33.. code-block:: c++34 35  extern "C" {36    typedef int InExternC; // Left intact.37  }38 39This check requires using C++11 or higher to run.40 41Options42-------43 44.. option:: IgnoreMacros45 46   If set to `true`, the check will not give warnings inside macros. Default47   is `true`.48 49.. option:: IgnoreExternC50 51   If set to `true`, the check will not give warning inside ``extern "C"``52   scope. Default is `false`53