// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.webkit.UncountedCallArgsChecker -verify %s -std=c++2c #include "mock-types.h" class Node : public CanMakeWeakPtr { public: Node* nextSibling() const; void ref() const; void deref() const; }; template struct pair { A a; B b; template requires ( I == 0 ) A& get(); template requires ( I == 1 ) B& get(); }; namespace std { template struct tuple_size; template struct tuple_element; template struct tuple_size<::pair> { static constexpr int value = 2; }; template struct tuple_element<0, ::pair> { using type = A; }; template struct tuple_element<1, ::pair> { using type = B; }; } pair, RefPtr> &getPair(); static void testUnpackedAssignment() { auto [a, b] = getPair(); a->nextSibling(); } pair, WeakPtr> getStrongWeakPair(); pair, RefPtr> getWeakStrongPair(); static void testUnpackedAssignmentWithWeak() { auto [a, b] = getStrongWeakPair(); a->nextSibling(); b->nextSibling(); // expected-warning@-1{{Call argument for 'this' parameter is uncounted and unsafe [alpha.webkit.UncountedCallArgsChecker]}} auto [c, d] = getWeakStrongPair(); c->nextSibling(); // expected-warning@-1{{Call argument for 'this' parameter is uncounted and unsafe [alpha.webkit.UncountedCallArgsChecker]}} d->nextSibling(); }