Date: Wed, 31 Jan 2024 01:38:54 +0000 From: bugzilla-noreply@freebsd.org To: toolchain@FreeBSD.org Subject: [Bug 276738] clang: static_assert conflicts with -std=c++98 -pedantic-errors Message-ID: <bug-276738-29464-IXEcj4mjfl@https.bugs.freebsd.org/bugzilla/> In-Reply-To: <bug-276738-29464@https.bugs.freebsd.org/bugzilla/> References: <bug-276738-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=3D276738 Mark Millard <marklmi26-fbsd@yahoo.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |marklmi26-fbsd@yahoo.com --- Comment #1 from Mark Millard <marklmi26-fbsd@yahoo.com> --- static_assert was added to C++ in C++ 11: after C++ 98. The /usr/include/c++/v1/__algorithm/iterator_operations.h code: template <class _Iter> _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 static void __validate_iter_reference() { static_assert(is_same<__deref_t<_Iter>, typename iterator_traits<__remove_cvref_t<_Iter> >::reference>::value, "It looks like your iterator's `iterator_traits<It>::reference` does not match the return type of " "dereferencing the iterator, i.e., calling `*it`. This is undefined behavior according to [input.iterators] " "and can lead to dangling reference issues at runtime, so we are flagging this."); } is not compliant with the C++98 standard. But . . . https://libcxx.llvm.org reports: QUOTE libc++ is a new implementation of the C++ standard library, targeting C++11= and above. Features and Goals Correctness as defined by the C++11 standard. END QUOTE So: Not a bug. FreeBSD gave up on C++98 when it decided to be based, in part, on libc++ . --=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-276738-29464-IXEcj4mjfl>