| // RUN: %check_clang_tidy %s zircon-fbl-type-traits %t -- -- -isystem %S/Inputs/zircon |
| |
| #include <fbl/type_support.h> |
| // CHECK-MESSAGES: :[[@LINE-1]]:1: warning: including fbl/type_support.h is deprecated |
| // CHECK-FIXES-NOT: #include <fbl/type_support.h> |
| // CHECK-FIXES: #include <type_traits> |
| |
| namespace fbl { |
| |
| template <class T> |
| class is_void {}; |
| |
| is_void<short> p; |
| |
| template <class T> |
| class is_null_pointer {}; |
| |
| is_null_pointer<short> d; |
| |
| } // namespace fbl |
| |
| namespace std { |
| |
| template <class T> |
| class is_void {}; |
| |
| is_void<short> x; |
| |
| template <class T> |
| class is_null_pointer {}; |
| |
| is_null_pointer<short> y; |
| |
| } // namespace std |
| |
| #define DECLARE() fbl::is_void<short> y |
| // CHECK-MESSAGES: :[[@LINE-1]]:19: warning: use of fbl::is_void is deprecated, use std::is_void instead |
| // CHECK-FIXES: #define DECLARE() std::is_void<short> y |
| |
| #define DECLAREB() fbl::is_null_pointer<short> z |
| // CHECK-MESSAGES: :[[@LINE-1]]:20: warning: use of fbl::is_null_pointer is deprecated, use std::is_null_pointer instead |
| // CHECK-FIXES: #define DECLAREB() std::is_null_pointer<short> z |
| |
| int main() { |
| fbl::is_void<short> a; |
| // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use of fbl::is_void is deprecated, use std::is_void instead |
| // CHECK-FIXES: std::is_void<short> a; |
| std::is_void<short> b; |
| |
| auto c = fbl::is_void<short>(); |
| // CHECK-MESSAGES: :[[@LINE-1]]:12: warning: use of fbl::is_void is deprecated, use std::is_void instead |
| // CHECK-FIXES: auto c = std::is_void<short>(); |
| auto d = std::is_void<short>(); |
| |
| fbl::is_null_pointer<short> e; |
| // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use of fbl::is_null_pointer is deprecated, use std::is_null_pointer instead |
| // CHECK-FIXES: std::is_null_pointer<short> e; |
| std::is_null_pointer<short> f; |
| |
| auto g = fbl::is_null_pointer<short>(); |
| // CHECK-MESSAGES: :[[@LINE-1]]:12: warning: use of fbl::is_null_pointer is deprecated, use std::is_null_pointer instead |
| // CHECK-FIXES: auto g = std::is_null_pointer<short>(); |
| auto h = std::is_null_pointer<short>(); |
| |
| DECLARE(); |
| DECLAREB(); |
| } |