Date: Fri, 31 May 2024 23:07:22 +0000 From: bugzilla-noreply@freebsd.org To: toolchain@FreeBSD.org Subject: [Bug 279443] LIBCPP assertions are enabled in optimized builds when -DNDEBUG is given to clang Message-ID: <bug-279443-29464-JwcL9iqEWL@https.bugs.freebsd.org/bugzilla/> In-Reply-To: <bug-279443-29464@https.bugs.freebsd.org/bugzilla/> References: <bug-279443-29464@https.bugs.freebsd.org/bugzilla/>
next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D279443 --- Comment #3 from Mark Millard <marklmi26-fbsd@yahoo.com> --- cppreference.com reports the following for C only: 3) special case: & and * cancel each other, neither one is evaluated 4) special case: & and the * that is implied in [] cancel each other, only = the addition implied in [] is evaluated. For C++ it reports: Note that, unlike C99 and later C versions, there's no special case for the unary operator& applied to the result of the unary operator*. But I've not tried to see what any fairly modern C++ standard says about such and cppreference.com is not explicit about the & and [] combination in contexts that could possibly use &*(a+i) as a valid translation. If cppreference.com is correct, modern C++ may well require avoiding the &a[i] notation for the non-dereferenceable case: only use such for dereferenceable accesses, even for for likes of std::contiguous_iterator contexts. Again, I'm not sure because I've not analyzed any relevant version of the standard for the issue. --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-279443-29464-JwcL9iqEWL>