| 1 |
// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.webkit.UncountedCallArgsChecker -verify %s -std=c++2c |
| 2 |
// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.webkit.UncheckedLocalVarsChecker -verify %s -std=c++2c |
| 3 |
|
| 4 |
// expected-no-diagnostics |
| 5 |
|
| 6 |
#include "mock-types.h" |
| 7 |
|
| 8 |
class Node { |
| 9 |
public: |
| 10 |
Node* nextSibling() const; |
| 11 |
|
| 12 |
void ref() const; |
| 13 |
void deref() const; |
| 14 |
}; |
| 15 |
|
| 16 |
template <class A, class B> struct pair { |
| 17 |
A a; |
| 18 |
B b; |
| 19 |
template <unsigned I> requires ( I == 0 ) A& get(); |
| 20 |
template <unsigned I> requires ( I == 1 ) B& get(); |
| 21 |
}; |
| 22 |
|
| 23 |
namespace std { |
| 24 |
template <class> struct tuple_size; |
| 25 |
template <unsigned, class> struct tuple_element; |
| 26 |
template <class A, class B> struct tuple_size<::pair<A, B>> { static constexpr int value = 2; }; |
| 27 |
template <class A, class B> struct tuple_element<0, ::pair<A, B>> { using type = A; }; |
| 28 |
template <class A, class B> struct tuple_element<1, ::pair<A, B>> { using type = B; }; |
| 29 |
} |
| 30 |
|
| 31 |
pair<RefPtr<Node>, RefPtr<Node>> &getPair(); |
| 32 |
|
| 33 |
static void testUnpackedAssignment() { |
| 34 |
auto [a, b] = getPair(); |
| 35 |
a->nextSibling(); |
| 36 |
} |