[Bug c++/108536] Difference when using requires and enable_if with class constructor

2023-01-25 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108536 Andrew Pinski changed: What|Removed |Added Resolution|--- |INVALID Status|UNCONFIRMED

[Bug c++/108536] Difference when using requires and enable_if with class constructor

2023-01-25 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108536 --- Comment #3 from Jonathan Wakely --- Because a requires-clause is not just different syntax for enable_if, it works differently. Different things are different. If you want exactly the same behaviour as your enable_if version (which you did

[Bug c++/108536] Difference when using requires and enable_if with class constructor

2023-01-25 Thread hr.jonas.hansen at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108536 --- Comment #2 from hr.jonas.hansen at gmail dot com --- I can see that, and that would work. But it really seems like a work-around? Is there a reason for the difference in behavior?

[Bug c++/108536] Difference when using requires and enable_if with class constructor

2023-01-25 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108536 --- Comment #1 from Jonathan Wakely --- This is not a bug, you've just transformed your working code to use a requires-clause incorrectly. This works fine: template > requires (!std::derived_from) && std::construct