diff options
Diffstat (limited to 'clang-tools-extra/test/clang-tidy/readability-container-size-empty.cpp')
| -rw-r--r-- | clang-tools-extra/test/clang-tidy/readability-container-size-empty.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/clang-tools-extra/test/clang-tidy/readability-container-size-empty.cpp b/clang-tools-extra/test/clang-tidy/readability-container-size-empty.cpp index e43feb92450..7fcfb500a25 100644 --- a/clang-tools-extra/test/clang-tidy/readability-container-size-empty.cpp +++ b/clang-tools-extra/test/clang-tidy/readability-container-size-empty.cpp @@ -3,8 +3,8 @@ namespace std { template <typename T> struct vector { vector() {} - unsigned long size() const {} - bool empty() const {} + unsigned long size() const; + bool empty() const; }; } @@ -54,6 +54,10 @@ int main() { ; if (1 < vect.size()) // no warning ; + if (vect.size() <= 1) // no warning + ; + if (1 >= vect.size()) // no warning + ; if (!vect.size()) ; // CHECK-MESSAGES: :[[@LINE-2]]:8: warning: the 'empty' method should be used |

