public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/108024] New: std::format_string's constructor has the wrong constraint
@ 2022-12-08 17:32 hewillk at gmail dot com
  2022-12-09  0:38 ` [Bug libstdc++/108024] " redi at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: hewillk at gmail dot com @ 2022-12-08 17:32 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108024

            Bug ID: 108024
           Summary: std::format_string's constructor has the wrong
                    constraint
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hewillk at gmail dot com
  Target Milestone: ---

format#L3628:

  template<typename _CharT, typename... _Args>
    template<convertible_to<basic_string_view<_CharT>> _Tp>
      consteval
      basic_format_string<_CharT, _Args...>::
      basic_format_string(const _Tp& __s)
      : _M_str(__s)

From [format.fmt.string]: "Constraints: const T& models
convertible_­to<basic_­string_­view<charT>>." We should use the requires-clause
to constrain const _Tp instead of _Tp. Testcase:

    #include <format>

    struct Str {
      consteval operator std::string_view() const { return ""; }
      operator std::string_view() = delete;
    };

    int main() {
      return std::format(Str{}).size();
    }

https://godbolt.org/z/xjq5K9YGo

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug libstdc++/108024] std::format_string's constructor has the wrong constraint
  2022-12-08 17:32 [Bug libstdc++/108024] New: std::format_string's constructor has the wrong constraint hewillk at gmail dot com
@ 2022-12-09  0:38 ` redi at gcc dot gnu.org
  2022-12-12 14:01 ` cvs-commit at gcc dot gnu.org
  2022-12-12 14:04 ` redi at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: redi at gcc dot gnu.org @ 2022-12-09  0:38 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108024

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2022-12-09
           Assignee|unassigned at gcc dot gnu.org      |redi at gcc dot gnu.org
   Target Milestone|---                         |13.0
             Status|UNCONFIRMED                 |ASSIGNED

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug libstdc++/108024] std::format_string's constructor has the wrong constraint
  2022-12-08 17:32 [Bug libstdc++/108024] New: std::format_string's constructor has the wrong constraint hewillk at gmail dot com
  2022-12-09  0:38 ` [Bug libstdc++/108024] " redi at gcc dot gnu.org
@ 2022-12-12 14:01 ` cvs-commit at gcc dot gnu.org
  2022-12-12 14:04 ` redi at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-12-12 14:01 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108024

--- Comment #1 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:

https://gcc.gnu.org/g:6c0f9584013dbedeacacb041d40ce9005b902df0

commit r13-4614-g6c0f9584013dbedeacacb041d40ce9005b902df0
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Mon Dec 12 11:40:07 2022 +0000

    libstdc++: Fix constraint on std::basic_format_string [PR108024]

    Also remove some redundant std::move calls for return statements.

    libstdc++-v3/ChangeLog:

            PR libstdc++/108024
            * include/std/format (basic_format_string): Fix constraint.
            * testsuite/std/format/format_string.cc: New test.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug libstdc++/108024] std::format_string's constructor has the wrong constraint
  2022-12-08 17:32 [Bug libstdc++/108024] New: std::format_string's constructor has the wrong constraint hewillk at gmail dot com
  2022-12-09  0:38 ` [Bug libstdc++/108024] " redi at gcc dot gnu.org
  2022-12-12 14:01 ` cvs-commit at gcc dot gnu.org
@ 2022-12-12 14:04 ` redi at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: redi at gcc dot gnu.org @ 2022-12-12 14:04 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108024

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Fixed, thanks for the report.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-12-12 14:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-08 17:32 [Bug libstdc++/108024] New: std::format_string's constructor has the wrong constraint hewillk at gmail dot com
2022-12-09  0:38 ` [Bug libstdc++/108024] " redi at gcc dot gnu.org
2022-12-12 14:01 ` cvs-commit at gcc dot gnu.org
2022-12-12 14:04 ` redi at gcc dot gnu.org

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).