================
@@ -283,9 +283,20 @@
 // - `_LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR` -- checks any operations that 
exchange nodes between containers to make sure
 //   the containers have compatible allocators.
 //
+// - `_LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN` -- checks that the given argument 
is within the domain of valid arguments
+//   for the function. Violating this typically produces an incorrect result 
(e.g. the clamp algorithm returns the
+//   original value without clamping it due to incorrect functors) or puts an 
object into an invalid state (e.g.
+//   a string view where only a subset of elements is possible to access). 
This doesn't cause an immediate issue within
+//   the library but is always a logic bug and is likely to cause problems 
within user code.
+//   This is somewhat of a catch-all (or fallback) category -- it covers 
errors triggered by user input that don't have
+//   a more specific category defined (which is always preferable when 
available).
+//
 // - `_LIBCPP_ASSERT_PEDANTIC` -- checks prerequisites which are imposed by 
the Standard, but violating which happens to
 //   be benign in our implementation.
 //
+// - `_LIBCPP_ASSERT_INTRUSIVE` -- for assertions that perform intrusive and 
typically very expensive validations of
----------------
var-const wrote:

Went with `_LIBCPP_ASSERT_SEMANTIC_REQUIREMENT` -- I think this captures the 
intention well and implies two important properties of the check (usually a 
heuristic and often expensive).

https://github.com/llvm/llvm-project/pull/77405
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to