| // RUN: %check_clang_tidy %s zircon-fbl-limits %t -- -- -isystem %S/Inputs/zircon |
| |
| #include <fbl/limits.h> |
| // CHECK-MESSAGES: :[[@LINE-1]]:1: warning: including fbl/limits.h is deprecated |
| // CHECK-FIXES-NOT: #include <fbl/limits.h> |
| // CHECK-FIXES: #include <limits> |
| |
| namespace fbl { |
| |
| template <class T> |
| class numeric_limits {}; |
| |
| #define SPECIALIZE_INT_FBL(type) \ |
| template <> \ |
| class numeric_limits<type> {}; |
| |
| SPECIALIZE_INT_FBL(short) |
| |
| numeric_limits<short> lim; |
| |
| } // namespace fbl |
| |
| namespace std { |
| |
| template <class T> |
| class numeric_limits {}; |
| |
| #define SPECIALIZE_INT_STD(type) \ |
| template <> \ |
| class numeric_limits<type> {}; |
| |
| SPECIALIZE_INT_STD(short) |
| |
| numeric_limits<short> lim; |
| |
| } // namespace std |
| |
| #define DECLARE() fbl::numeric_limits<short> macrolim |
| // CHECK-MESSAGES: :[[@LINE-1]]:19: warning: use of fbl::numeric_limits is deprecated, use std::numeric_limits instead |
| // CHECK-FIXES: #define DECLARE() std::numeric_limits<short> macrolim |
| |
| int main() { |
| fbl::numeric_limits<short> fbllim; |
| // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use of fbl::numeric_limits is deprecated, use std::numeric_limits instead |
| // CHECK-FIXES: std::numeric_limits<short> fbllim; |
| std::numeric_limits<short> stdlim; |
| |
| auto fbllimauto = fbl::numeric_limits<short>(); |
| // CHECK-MESSAGES: :[[@LINE-1]]:21: warning: use of fbl::numeric_limits is deprecated, use std::numeric_limits instead |
| // CHECK-FIXES: auto fbllimauto = std::numeric_limits<short>(); |
| auto stdlimauto = std::numeric_limits<short>(); |
| |
| DECLARE(); |
| } |