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