diff --git a/clang-tools-extra/test/clang-tidy/checkers/bugprone-standalone-empty.cpp b/clang-tools-extra/test/clang-tidy/checkers/bugprone-standalone-empty.cpp deleted file mode 100644 --- a/clang-tools-extra/test/clang-tidy/checkers/bugprone-standalone-empty.cpp +++ /dev/null @@ -1,79 +0,0 @@ -// RUN: %check_clang_tidy %s bugprone-standalone-empty %t - -namespace std { - -template -struct vector { - bool empty(); - void clear(); -}; - -template -bool empty(T &&); - -} // namespace std - -namespace absl { -template -struct vector { - bool empty(); - void clear(); -}; - -template -bool empty(T &&); -} // namespace absl - -int test_member_empty() { - std::vector v; - - v.empty(); - // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: ignoring the result of 'empty()', did you mean 'clear()'? [bugprone-standalone-empty] - // CHECK-FIXES: {{^ }}v.clear();{{$}} - - absl::vector w; - - w.empty(); - // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: ignoring the result of 'empty()', did you mean 'clear()'? [bugprone-standalone-empty] - // CHECK-FIXES: {{^ }}w.clear();{{$}} -} - -int test_qualified_empty() { - absl::vector v; - - std::empty(v); - // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: ignoring the result of 'std::empty' [bugprone-standalone-empty] - // CHECK-FIXES: {{^ }}v.clear();{{$}} - - absl::empty(v); - // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: ignoring the result of 'absl::empty' [bugprone-standalone-empty] - // CHECK-FIXES: {{^ }}v.clear();{{$}} -} - -int test_unqualified_empty() { - std::vector v; - - empty(v); - // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: ignoring the result of 'std::empty' [bugprone-standalone-empty] - // CHECK-FIXES: {{^ }}v.clear();{{$}} - - absl::vector w; - - empty(w); - // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: ignoring the result of 'absl::empty' [bugprone-standalone-empty] - // CHECK-FIXES: {{^ }}w.clear();{{$}} - - { - using std::empty; - empty(v); - // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: ignoring the result of 'std::empty' [bugprone-standalone-empty] - // CHECK-FIXES: {{^ }} v.clear();{{$}} - } - - { - using absl::empty; - empty(w); - // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: ignoring the result of 'absl::empty' [bugprone-standalone-empty] - // CHECK-FIXES: {{^ }} w.clear();{{$}} - } -}