public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/114625] New: requires { T{}; } wrongly accepted when T{} is ill-formed
@ 2024-04-07  8:38 ted at lyncon dot se
  2024-04-07  8:42 ` [Bug c++/114625] requires { T{}; } wrongly accepted when T{} is ill-formed while in concept ted at lyncon dot se
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: ted at lyncon dot se @ 2024-04-07  8:38 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 114625
           Summary: requires { T{}; } wrongly accepted when T{} is
                    ill-formed
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ted at lyncon dot se
  Target Milestone: ---

This program compiles but I'd expect both `static_assert`s to refuse it since
`d x{};` is invalid.
```
#include <concepts>

template<class T>
concept default_initializable =
    std::constructible_from<T> &&
    requires { T{}; } &&
    requires { ::new T; };

struct b { explicit b(auto...) {} };
struct d : b {};

int main() {
    static_assert(default_initializable<d>);
    static_assert(std::default_initializable<d>);
    //d x{}; // ERROR
}
```

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

end of thread, other threads:[~2024-04-15 20:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-07  8:38 [Bug c++/114625] New: requires { T{}; } wrongly accepted when T{} is ill-formed ted at lyncon dot se
2024-04-07  8:42 ` [Bug c++/114625] requires { T{}; } wrongly accepted when T{} is ill-formed while in concept ted at lyncon dot se
2024-04-07  9:07 ` pinskia at gcc dot gnu.org
2024-04-10 22:21 ` [Bug c++/114625] requires { T{}; } wrongly returns false " ppalka at gcc dot gnu.org
2024-04-11 14:59 ` mpolacek at gcc dot gnu.org
2024-04-15 18:20 ` ted at lyncon dot se
2024-04-15 20:12 ` [Bug c++/114625] requires { T{}; } wrongly returns true when T{} is ill-formed while in concept/decltype 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).