| 1 |
// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.webkit.UncountedCallArgsChecker -verify %s |
| 2 |
// expected-no-diagnostics |
| 3 |
|
| 4 |
#include "mock-types.h" |
| 5 |
|
| 6 |
void __libcpp_verbose_abort(const char *__format, ...); |
| 7 |
|
| 8 |
using size_t = __typeof(sizeof(int)); |
| 9 |
namespace std{ |
| 10 |
template <class T, size_t N> |
| 11 |
class array { |
| 12 |
T elements[N]; |
| 13 |
|
| 14 |
public: |
| 15 |
T& operator[](unsigned i) { |
| 16 |
if (i >= N) { |
| 17 |
__libcpp_verbose_abort("%s", "aborting"); |
| 18 |
} |
| 19 |
return elements[i]; |
| 20 |
} |
| 21 |
}; |
| 22 |
} |
| 23 |
|
| 24 |
class ArrayClass { |
| 25 |
public: |
| 26 |
void ref() const; |
| 27 |
void deref() const; |
| 28 |
typedef std::array<std::array<double, 4>, 4> Matrix; |
| 29 |
double e() { return matrix[3][0]; } |
| 30 |
Matrix matrix; |
| 31 |
}; |
| 32 |
|
| 33 |
class AnotherClass { |
| 34 |
RefPtr<ArrayClass> matrix; |
| 35 |
void test() { |
| 36 |
double val = { matrix->e()}; |
| 37 |
} |
| 38 |
}; |
| 39 |
|