public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/109136] New: [concepts] initializer_list constructor constraint should require static_cast for explicit conversion operator
@ 2023-03-14 22:25 ldalessandro at gmail dot com
  2023-03-14 22:35 ` [Bug c++/109136] initializer_list constructor constraint and " pinskia at gcc dot gnu.org
  2023-03-14 22:45 ` [Bug c++/109136] initializer_list constructor " pinskia at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: ldalessandro at gmail dot com @ 2023-03-14 22:25 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 109136
           Summary: [concepts] initializer_list constructor constraint
                    should require static_cast for explicit conversion
                    operator
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ldalessandro at gmail dot com
  Target Milestone: ---

The following concept should fail the static_assert, but passes (I should need
a static_cast here).

```
    #include <initializer_list>

    template <class From, class To>
    concept implicit_convertible_to = requires(From x) { 
        std::initializer_list<To>{ x }; 
    };

    struct foo {
        explicit operator int();
    };

    static_assert(implicit_convertible_to<foo, int>);

```

Live: https://godbolt.org/z/GffP9f8o7

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

end of thread, other threads:[~2023-03-14 22:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-14 22:25 [Bug c++/109136] New: [concepts] initializer_list constructor constraint should require static_cast for explicit conversion operator ldalessandro at gmail dot com
2023-03-14 22:35 ` [Bug c++/109136] initializer_list constructor constraint and " pinskia at gcc dot gnu.org
2023-03-14 22:45 ` [Bug c++/109136] initializer_list constructor " pinskia 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).