[libcxx-commits] [libcxx] [libc++][hardening] Don't trigger redundant checks in the fast mode. (PR #77176)

Konstantin Varlamov via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jan 5 20:27:32 PST 2024


================
@@ -74,7 +74,8 @@ class directory_iterator {
 
   _LIBCPP_HIDE_FROM_ABI const directory_entry& operator*() const {
     // Note: this check duplicates a check in `__dereference()`.
-    _LIBCPP_ASSERT_NON_NULL(__imp_, "The end iterator cannot be dereferenced");
+    _LIBCPP_REDUNDANT_ASSERTION( //
----------------
var-const wrote:

The artificial comment is to force `clang-format` not to merge this statement into a single line. I find that having both macros in the same line makes it oversaturated, so to say.

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


More information about the libcxx-commits mailing list