This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/57888] New: using non-type template parameter in constexpr function for non static data member intializer segfaults


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

            Bug ID: 57888
           Summary: using non-type template parameter in constexpr
                    function for non static data member intializer
                    segfaults
           Product: gcc
           Version: 4.8.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: plasmahh at gmx dot net

While trying to find workaronuds for Bug #57887 I tried the following code:

struct B
{
        template<int N>
        struct A
        {
                constexpr int get_N() { return N; }

//              int X = N;
                int X = get_N();
                void foo( )
                {
                        int x = N;
                }
        };
};

Which made gcc segfault. Whatever the validity of #57887 is, I don't think it
should segfault here...


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]