[clang] [WebKit Checkers] Make TrivialFunctionAnalysis recognize std::array::operator[] as trivial (PR #113377)
Ryosuke Niwa via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 22 14:17:50 PDT 2024
================
@@ -0,0 +1,33 @@
+// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.webkit.UncountedCallArgsChecker -verify %s
+// expected-no-diagnostics
+
+#include "mock-types.h"
+
+using size_t = __typeof(sizeof(int));
+namespace std{
+template <class T, size_t N>
+class array {
+ T elements[N];
+
+ public:
+ T& operator[](unsigned i) { return elements[i]; }
----------------
rniwa wrote:
It seems that we need to call __libcpp_verbose_abort inside this function to make this test fail without the PR.
Can we also add a method which explicitly calls __libcpp_verbose_abort to
clang/test/Analysis/Checkers/WebKit/uncounted-obj-arg.cpp
Like something like https://github.com/rniwa/llvm-project/commit/820bab8fb581f2fcd1a96b495f4762b02195d86a
https://github.com/llvm/llvm-project/pull/113377
More information about the cfe-commits
mailing list