diff options
author | Krystyna Gajczyk <krystyna.gajczyk@gmail.com> | 2017-04-02 19:12:20 +0000 |
---|---|---|
committer | Krystyna Gajczyk <krystyna.gajczyk@gmail.com> | 2017-04-02 19:12:20 +0000 |
commit | 3a42e73c3fe6ee69bd70241659fd36ae4335ad0a (patch) | |
tree | f6ea694f0214196e6f0ea92dbc5bb35721d561ee /clang-tools-extra/test/clang-tidy/modernize-use-using-macros.cpp | |
parent | 70e4f434ae2da6c178460f920de9315dc435d669 (diff) | |
download | bcm5719-llvm-3a42e73c3fe6ee69bd70241659fd36ae4335ad0a.tar.gz bcm5719-llvm-3a42e73c3fe6ee69bd70241659fd36ae4335ad0a.zip |
Fixes for modernize-use-using check:
- removed unnessacary namespaces
- added option to print warning in macros
- no fix for typedef with array
- removed "void" word from functions with 0 parameters
Differential Revision: https://reviews.llvm.org/D29262
llvm-svn: 299340
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; |