0

なぜこれが起こるのか理解に苦しんでいます。おそらくバグです。

#include <thread>
#include <cstdio>
using namespace std;

int main(){
    int y=2;
    float fa[2][y]; // thread compile fine if y were 2 hardcoded instead
    fa[0][0]=0.8;
    fa[0][1]=1.8;
    auto fx=[&](){
        for(int c=0;c<2;c++){ // thread compile fine if c<2 were c<1 instead
            printf("\n%f",fa[0][c]); // (1*) "internal compiler error: in expand_expr_real_1, at expr.c:9327"
        }
    };
    fx(); // works fine everytime
    thread(fx).join(); //error (1*)
}

コメントの仕方を変更した場合にのみコンパイルされるのはなぜですか?

winpthreads で gcc 4.8.0 を使用しています。

4

0 に答える 0