[cfe-dev] array extended initializer lists

Vinxxe vinxxe at gmail.com
Tue Jul 24 03:19:58 PDT 2012


Hi,
is it possible, with some compiler option, to compile the following
code with clang?
//------------------------------------
int main(){

  int x[10];

  x={1,2,3,4,5,6,7,8,9,0};

}
//-------------------------------------


I tried this

clang -c main.cc -std=gnu++11

and got the following error:

main.cc:5:4: error: array type 'int [10]' is not assignable
  x={1,2,3,4,5,6,7,8,9,0};

then without options

clang -c main.cc

I got the following error:

main.cc:5:5: error: expected expression
  x={1,2,3,4,5,6,7,8,9,0};

thank you

V



More information about the cfe-dev mailing list