public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Deev Patel <pateldeev@nevada.unr.edu>
To: gcc-patches@gcc.gnu.org
Subject: [PATCH] libstdc++: Add missing constexpr specifier and function overloads
Date: Sun, 23 Jul 2023 20:28:02 -0700	[thread overview]
Message-ID: <CACJEya+wn7RxPr5t=MYr5Xedh7q4q=CfwiA=qPP7mk4uRq7zNw@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1421 bytes --]

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  <pateldeev@nevada.unr.edu>

	* include/std/format: Add missing constexpr specifiers on function overloads


From ac34afa1109b4c82e5cc377f49abf55422b89529 Mon Sep 17 00:00:00 2001
From: Deev Patel <pateldeev@nevada.unr.edu>
Date: Sun, 23 Jul 2023 20:08:46 -0700
Subject: [PATCH] [libstdc++] Add missing constexpr specifiers on function
 overloads

---
 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>;
-- 
2.41.0

             reply	other threads:[~2023-07-24  3:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-24  3:28 Deev Patel [this message]
2023-07-24 20:15 ` Jonathan Wakely

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CACJEya+wn7RxPr5t=MYr5Xedh7q4q=CfwiA=qPP7mk4uRq7zNw@mail.gmail.com' \
    --to=pateldeev@nevada.unr.edu \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).