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

Endre Fülöp via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 3 01:17:05 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
----------------
gamesh411 wrote:

Fixed.

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


More information about the cfe-commits mailing list