http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57820

Harald van Dijk <harald at gigawatt dot nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |harald at gigawatt dot nl

--- Comment #2 from Harald van Dijk <harald at gigawatt dot nl> ---
Adding an user-defined constexpr C() {} makes it fail more clearly:

struct C
{
    int a = 2;
    int b = a + 1;

    constexpr C() {}
};


test.cc: In constructor ‘constexpr C::C()’:
test.cc:6:20: sorry, unimplemented: use of the value of the object being
constructed in a constant expression
     constexpr C() {}

and indeed, if `int b = a + 1;` is changed to `int b = 3;`, G++ accepts it.

Reply via email to