Lines Matching full:size
1 // RUN: %check_clang_tidy -std=c++14-or-later %s readability-container-size-empty %t -- \
2 // RUN: -config="{CheckOptions: {readability-container-size-empty.ExcludedComparisonTypes: '::std::…
11 unsigned long size() const;
20 unsigned long size() const;
36 unsigned long size() const;
45 unsigned long size() const;
51 bool size() const;
57 enum E size() const;
64 unsigned long size() const;
73 unsigned long size() const;
74 bool empty() const { return size() == 0; } in empty()
79 unsigned long size() const;
83 bool Container3::empty() const { return this->size() == 0; } in empty()
88 unsigned long size() const;
93 constexpr unsigned size() const { return 0; } in size() function
111 (void)(str.size() + 0); in returnsBool()
113 (void)(str.size() - 0); in returnsBool()
115 (void)(0 + str.size()); in returnsBool()
117 (void)(0 - str.size()); in returnsBool()
119 if (intSet.size() == 0) in returnsBool()
121 …y' method should be used to check for emptiness instead of 'size' [readability-container-size-empt… in returnsBool()
133 if (str.size() == 0) in returnsBool()
135 …:[[@LINE-2]]:7: warning: the 'empty' method should be used to check for emptiness instead of 'size' in returnsBool()
141 if ((str + str2).size() == 0) in returnsBool()
143 …:[[@LINE-2]]:7: warning: the 'empty' method should be used to check for emptiness instead of 'size' in returnsBool()
157 if (wstr.size() == 0) in returnsBool()
159 …:[[@LINE-2]]:7: warning: the 'empty' method should be used to check for emptiness instead of 'size' in returnsBool()
170 if (vect.size() == 0) in returnsBool()
172 …:[[@LINE-2]]:7: warning: the 'empty' method should be used to check for emptiness instead of 'size' in returnsBool()
178 if (vect.size() != 0) in returnsBool()
186 if (0 == vect.size()) in returnsBool()
190 if (0 != vect.size()) in returnsBool()
202 if (vect.size() > 0) in returnsBool()
206 if (0 < vect.size()) in returnsBool()
210 if (vect.size() < 1) in returnsBool()
214 if (1 > vect.size()) in returnsBool()
218 if (vect.size() >= 1) in returnsBool()
222 if (1 <= vect.size()) in returnsBool()
226 if (vect.size() > 1) // no warning in returnsBool()
228 if (1 < vect.size()) // no warning in returnsBool()
230 if (vect.size() <= 1) // no warning in returnsBool()
232 if (1 >= vect.size()) // no warning in returnsBool()
234 if (!vect.size()) in returnsBool()
238 if (vect.size()) in returnsBool()
247 if (vect2.size() != 0) in returnsBool()
253 if (vect3->size() == 0) in returnsBool()
257 if ((*vect3).size() == 0) in returnsBool()
273 if (vect4.size() == 0) in returnsBool()
283 if (templated_container.size() == 0) in returnsBool()
291 if (templated_container.size() != 0) in returnsBool()
299 if (0 == templated_container.size()) in returnsBool()
307 if (0 != templated_container.size()) in returnsBool()
315 if (templated_container.size() > 0) in returnsBool()
319 if (0 < templated_container.size()) in returnsBool()
323 if (templated_container.size() < 1) in returnsBool()
327 if (1 > templated_container.size()) in returnsBool()
331 if (templated_container.size() >= 1) in returnsBool()
335 if (1 <= templated_container.size()) in returnsBool()
339 if (templated_container.size() > 1) // no warning in returnsBool()
341 if (1 < templated_container.size()) // no warning in returnsBool()
343 if (templated_container.size() <= 1) // no warning in returnsBool()
345 if (1 >= templated_container.size()) // no warning in returnsBool()
347 if (!templated_container.size()) in returnsBool()
351 if (templated_container.size()) in returnsBool()
361 if (private_empty.size() == 0) in returnsBool()
365 if (private_empty.size() != 0) in returnsBool()
369 if (0 == private_empty.size()) in returnsBool()
373 if (0 != private_empty.size()) in returnsBool()
377 if (private_empty.size() > 0) in returnsBool()
379 if (0 < private_empty.size()) in returnsBool()
381 if (private_empty.size() < 1) in returnsBool()
383 if (1 > private_empty.size()) in returnsBool()
385 if (private_empty.size() >= 1) in returnsBool()
387 if (1 <= private_empty.size()) in returnsBool()
389 if (private_empty.size() > 1) in returnsBool()
391 if (1 < private_empty.size()) in returnsBool()
393 if (private_empty.size() <= 1) in returnsBool()
395 if (1 >= private_empty.size()) in returnsBool()
397 if (!private_empty.size()) in returnsBool()
399 if (private_empty.size()) in returnsBool()
402 // Types with weird size() return type. in returnsBool()
404 if (bs.size() == 0) in returnsBool()
407 if (es.size() == 0) in returnsBool()
411 if (derived.size() == 0) in returnsBool()
420 takesBool(derived.size()); in returnsBool()
424 takesBool(derived.size() == 0); in returnsBool()
428 takesBool(derived.size() != 0); in returnsBool()
432 bool b1 = derived.size(); in returnsBool()
436 bool b2(derived.size()); in returnsBool()
440 auto b3 = static_cast<bool>(derived.size()); in returnsBool()
444 auto b4 = (bool)derived.size(); in returnsBool()
448 auto b5 = bool(derived.size()); in returnsBool()
452 return derived.size(); in returnsBool()
460 ConstructWithBoolField(const std::vector<int> &C) : B(C.size()) {} in ConstructWithBoolField()
468 bool B = C.size();
475 return C.size() ? 0 : 1; in func()
482 static_assert(!L.size(), "");
488 void func() noexcept(L.size());
491 #define CHECKSIZE(x) if (x.size()) {}
492 // CHECK-FIXES: #define CHECKSIZE(x) if (x.size()) {}
496 if (v.size()) in f()
498 …y' method should be used to check for emptiness instead of 'size' [readability-container-size-empt… in f()
503 …d to check for emptiness instead of comparing to an empty object [readability-container-size-empty] in f()
512 if (templated_container.size()) in f()
528 if (s.size()) in f()
530 …y' method should be used to check for emptiness instead of 'size' [readability-container-size-empt… in f()
535 …method should be used to check for emptiness instead of 'length' [readability-container-size-empty] in f()
549 if (v.size()) in neverInstantiatedTemplate()
551 …y' method should be used to check for emptiness instead of 'size' [readability-container-size-empt… in neverInstantiatedTemplate()
557 …d to check for emptiness instead of comparing to an empty object [readability-container-size-empty] in neverInstantiatedTemplate()
560 if (v.size() == 0) in neverInstantiatedTemplate()
562 …y' method should be used to check for emptiness instead of 'size' [readability-container-size-empt… in neverInstantiatedTemplate()
565 if (v.size() != 0) in neverInstantiatedTemplate()
567 …y' method should be used to check for emptiness instead of 'size' [readability-container-size-empt… in neverInstantiatedTemplate()
570 if (v.size() < 1) in neverInstantiatedTemplate()
572 …y' method should be used to check for emptiness instead of 'size' [readability-container-size-empt… in neverInstantiatedTemplate()
575 if (v.size() > 0) in neverInstantiatedTemplate()
577 …y' method should be used to check for emptiness instead of 'size' [readability-container-size-empt… in neverInstantiatedTemplate()
580 if (v.size() == 1) in neverInstantiatedTemplate()
582 if (v.size() != 1) in neverInstantiatedTemplate()
584 if (v.size() == 2) in neverInstantiatedTemplate()
586 if (v.size() != 2) in neverInstantiatedTemplate()
589 if (static_cast<bool>(v.size())) in neverInstantiatedTemplate()
591 …y' method should be used to check for emptiness instead of 'size' [readability-container-size-empt… in neverInstantiatedTemplate()
594 if (v.size() && false) in neverInstantiatedTemplate()
596 …y' method should be used to check for emptiness instead of 'size' [readability-container-size-empt… in neverInstantiatedTemplate()
599 if (!v.size()) in neverInstantiatedTemplate()
601 …y' method should be used to check for emptiness instead of 'size' [readability-container-size-empt… in neverInstantiatedTemplate()
606 if (templated_container.size()) in neverInstantiatedTemplate()
617 while (templated_container.size()) in neverInstantiatedTemplate()
625 while (templated_container.size()); in neverInstantiatedTemplate()
630 for (; templated_container.size();) in neverInstantiatedTemplate()
636 if (true && templated_container.size()) in neverInstantiatedTemplate()
642 if (true || templated_container.size()) in neverInstantiatedTemplate()
648 if (!templated_container.size()) in neverInstantiatedTemplate()
654 bool b1 = templated_container.size(); in neverInstantiatedTemplate()
659 bool b2(templated_container.size()); in neverInstantiatedTemplate()
664 auto b3 = static_cast<bool>(templated_container.size()); in neverInstantiatedTemplate()
669 auto b4 = (bool)templated_container.size(); in neverInstantiatedTemplate()
674 auto b5 = bool(templated_container.size()); in neverInstantiatedTemplate()
679 takesBool(templated_container.size()); in neverInstantiatedTemplate()
681 // until the type of templated_container.size() is known in neverInstantiatedTemplate()
683 return templated_container.size(); in neverInstantiatedTemplate()
695 if (t.size()) in instantiatedTemplateWithSizeCall()
711 unsigned size() const { return 0; } in size() function in TypeWithSize
729 return ptr->size() > 0; in call_through_unique_ptr()
736 return (*ptr).size() > 0; in call_through_unique_ptr_deref()
744 size_type size() const;
750 if (ts.size() == 0) in testTypedefSize()
761 unsigned long size() const { return N; } in size() function
771 unsigned long size() const;
777 unsigned long size() const;
784 return value.size() == 0U; in testArraySize()
785 …y' method should be used to check for emptiness instead of 'size' [readability-container-size-empt… in testArraySize()
796 …d to check for emptiness instead of comparing to an empty object [readability-container-size-empty] in testDummyType()
822 int size() const;
827 unsigned size() const;
831 if (s.size() < 0) {} in f()
832 if (0 > s.size()) {} in f()
833 if (s.size() >= 0) {} in f()
834 if (0 <= s.size()) {} in f()
835 if (s.size() < 1) in f()
837 …y' method should be used to check for emptiness instead of 'size' [readability-container-size-empt… in f()
839 if (1 > s.size()) in f()
841 …y' method should be used to check for emptiness instead of 'size' [readability-container-size-empt… in f()
843 if (s.size() <= 0) in f()
845 …y' method should be used to check for emptiness instead of 'size' [readability-container-size-empt… in f()
847 if (0 >= s.size()) in f()
849 …y' method should be used to check for emptiness instead of 'size' [readability-container-size-empt… in f()
854 if (s.size() < 0) {} in f()
855 if (0 > s.size()) {} in f()
856 if (s.size() >= 0) {} in f()
857 if (0 <= s.size()) {} in f()
858 if (s.size() < 1) {} in f()
859 if (1 > s.size()) {} in f()
860 if (s.size() <= 0) {} in f()
861 if (0 >= s.size()) {} in f()
868 int size() const;
874 int size(int) const;
880 if (0 == s.size()) {} in f()
881 …y' method should be used to check for emptiness instead of 'size' [readability-container-size-empt… in f()
886 if (0 == s.size(1)) {} in f()
888 …method should be used to check for emptiness instead of 'length' [readability-container-size-empty] in f()