[clang] [clang][analyzer] Add OpaqueSTLFunctionsModeling (PR #178910)

Balázs Benics via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 3 03:38:21 PST 2026


================
@@ -142,5 +144,28 @@ shared_ptr<_Tp>::shared_ptr(nullptr_t) {
 }
 
 #endif // __has_feature(cxx_decltype)
+
+template<typename _RandomAccessIterator>
+void sort(_RandomAccessIterator __first, _RandomAccessIterator __last) {
+  // Fake error trigger
+  // std::sort is expected to be evaluated conservatively.
+  TRIGGER_DIV_BY_ZERO;
+}
+
+template<typename _RandomAccessIterator>
+void stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last) {
+  // Fake error trigger
+  // std::stable_sort is expected to be evaluated conservatively.
+  TRIGGER_DIV_BY_ZERO;
 }
 
+template<typename _BidirectionalIterator>
+void inplace_merge(_BidirectionalIterator __first,
+                   _BidirectionalIterator __middle,
+                   _BidirectionalIterator __last) {
+  // Fake error trigger
+  // std::inplace_merge is expected to be evaluated conservatively.
+  TRIGGER_DIV_BY_ZERO;
+  }
----------------
steakhal wrote:

```suggestion
}
```

https://github.com/llvm/llvm-project/pull/178910


More information about the cfe-commits mailing list