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

            Bug ID: 62149
           Summary: ICE in tsubst_copy, at cp/pt.c:12646  with constexpr
                    and tuple_size
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tower120 at gmail dot com

In the following code:

#include <iostream>
#include <string>
#include <vector>
#include <tuple>

using namespace std;

template<class ..._Attrs>
struct Test{
    using Attrs22 = tuple< _Attrs... >;
    Attrs22 attrs22;

    void setup(){
        int constexpr size2 = tuple_size<Attrs22>::value;
        int idsa[size2];

        //int idsa[tuple_size<Attrs22>::value];       // this works ok!

        auto fn =  [&](auto &&attr){
           idsa[0];
        };
        fn(11);        
    }
};


int main()
{
    Test<int, int, int> t;
    t.setup();  
}


Compiled with:
g++ -std=c++1y  -O3 -Winline -Wextra -pthread -pedantic-errors main.cpp -lm  &&
./a.out

I have the following error:
internal compiler error: in tsubst_copy, at cp/pt.c:12646
            idsa[0];
            ^
libbacktrace could not find executable to open


-------------------------------
P.S. If not use constexpr, all works fine.

Reply via email to