On 23/07/23 20:28 -0700, Deev Patel wrote:
Hi,
A couple of virtual functions in the libstdc++ format header are marked
constexpr in the base class, but not in the derived class. This was causing
build failures when trying to compile latest gcc libstd with clang 16 using
c++20. Adding the constexpr specifier resolves the issue.
2023-07-23 Deev Patel <pateld...@nevada.unr.edu>
* include/std/format: Add missing constexpr specifiers on function
overloads
Thanks for the patch, I'll test and push it.
N.B. libstdc++ patches should be CC'd to the libstdc++ mailing list,
or I won't see them (and rely on somebody bringing it to my
attention).
---
libstdc++-v3/include/std/format | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libstdc++-v3/include/std/format b/libstdc++-v3/include/std/format
index 9710bff3c03..0c6069b2681 100644
--- a/libstdc++-v3/include/std/format
+++ b/libstdc++-v3/include/std/format
@@ -3554,14 +3554,14 @@ namespace __format
using iterator = typename _Scanner<_CharT>::iterator;
- void
+ constexpr void
_M_on_chars(iterator __last) override
{
basic_string_view<_CharT> __str(this->begin(), __last);
_M_fc.advance_to(__format::__write(_M_fc.out(), __str));
}
- void
+ constexpr void
_M_format_arg(size_t __id) override
{
using _Context = basic_format_context<_Out, _CharT>;