]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Add missing constexpr specifiers in <format>
authorDeev Patel <pateldeev@nevada.unr.edu>
Mon, 24 Jul 2023 20:10:52 +0000 (21:10 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Mon, 24 Jul 2023 21:12:02 +0000 (22:12 +0100)
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 libstdc++ with
clang 16 using c++20. Adding the constexpr specifier resolves the issue.

libstdc++-v3/ChangeLog:

* include/std/format (_Formatting_scanner::_M_on_chars): Add
missing constexpr specifier.
(_Formatting_scanner::_M_format_arg): Likewise.

libstdc++-v3/include/std/format

index 9710bff3c0342e78cf5a6416674488b428080ef6..0c6069b268181ab9ed5d42faf19a0c8d2f13cc55 100644 (file)
@@ -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>;