diff options
Diffstat (limited to 'clang-tools-extra/test/clang-tidy/modernize-use-using-macros.cpp')
-rw-r--r-- | clang-tools-extra/test/clang-tidy/modernize-use-using-macros.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/clang-tools-extra/test/clang-tidy/modernize-use-using-macros.cpp b/clang-tools-extra/test/clang-tidy/modernize-use-using-macros.cpp new file mode 100644 index 00000000000..5d58d8156c2 --- /dev/null +++ b/clang-tools-extra/test/clang-tidy/modernize-use-using-macros.cpp @@ -0,0 +1,23 @@ +// RUN: %check_clang_tidy %s modernize-use-using %t -- \ +// RUN: -config="{CheckOptions: [{key: modernize-use-using.IgnoreMacros, value: 0}]}" \ +// RUN: -- -std=c++11 -I %S/Inputs/modernize-use-using + +#define CODE typedef int INT + +CODE; +// CHECK-MESSAGES: :[[@LINE-1]]:1: warning: use 'using' instead of 'typedef' +// CHECK-FIXES: #define CODE typedef int INT +// CHECK-FIXES: CODE; + +struct Foo; +#define Bar Baz +typedef Foo Bar; +// CHECK-MESSAGES: :[[@LINE-1]]:1: warning: use 'using' instead of 'typedef' +// CHECK-FIXES: #define Bar Baz +// CHECK-FIXES: using Baz = Foo; + +#define TYPEDEF typedef +TYPEDEF Foo Bak; +// CHECK-MESSAGES: :[[@LINE-1]]:1: warning: use 'using' instead of 'typedef' +// CHECK-FIXES: #define TYPEDEF typedef +// CHECK-FIXES: TYPEDEF Foo Bak; |