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

fchelnokov at gmail dot com gcc-bugzilla@gcc.gnu.org
Fri Feb 18 10:23:30 GMT 2022


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

--- Comment #5 from Fedor Chelnokov <fchelnokov at gmail dot com> ---
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;
    A(int) : A(A()) {}
};
```
which is accepted in GCC. Demo: https://gcc.godbolt.org/z/5PjraK5ox

Clang rejects it until one remove `A(const A&) = delete`, which is probably
another issue.


More information about the Gcc-bugs mailing list