[Bug c++/65695] [4.9/5 Regression] NSDMI calling constexpr constructor with pointer-to-member is not a constant expression

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Apr 8 11:02:00 GMT 2015


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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-04-08
            Summary|[4.9/5 Regression] calling  |[4.9/5 Regression] NSDMI
                   |constexpr constructor with  |calling constexpr
                   |pointer-to-member is not a  |constructor with
                   |constant expression         |pointer-to-member is not a
                   |                            |constant expression
     Ever confirmed|0                           |1

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Reduced:

struct Foo;

struct Bar
{
    using MemberT = int Foo::*;

    MemberT h_;

    constexpr Bar(MemberT h) : h_{h}
    {
    }
};

struct Foo
{
    int test = 0;

    static constexpr Bar bar {&Foo::test};
};

constexpr Bar Foo::bar;



More information about the Gcc-bugs mailing list