[Bug c++/104000] Ordinary constructor cannot delegate to `consteval` constructor

2022-02-18 Thread fchelnokov at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104000 --- Comment #5 from Fedor Chelnokov --- Based on stackoverflow answer, a modified example was found with the delegation to consteval constructor: ``` struct A { int i = 0; consteval A() = default; A(const A&) = delete;

[Bug c++/104000] Ordinary constructor cannot delegate to `consteval` constructor

2022-01-21 Thread fchelnokov at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104000 --- Comment #4 from Fedor Chelnokov --- If we take MSVC into consideration, then it rejects ``` struct A { consteval A() = default; A(int) : A() {} }; ``` which GCC accepts. So there is a divergence with MSVC as

[Bug c++/104000] Ordinary constructor cannot delegate to `consteval` constructor

2022-01-21 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104000 Andrew Pinski changed: What|Removed |Added Ever confirmed|1 |0 Status|NEW

[Bug c++/104000] Ordinary constructor cannot delegate to `consteval` constructor

2022-01-21 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104000 Andrew Pinski changed: What|Removed |Added Last reconfirmed||2022-01-21

[Bug c++/104000] Ordinary constructor cannot delegate to `consteval` constructor

2022-01-17 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104000 --- Comment #1 from Andrew Pinski --- The error is: : In constructor 'A::A(int)': :5:16: error: 'this' is not a constant expression 5 | A(int) : A() {} |^