Hi,<div><br></div><div>I'm curious if the enum values can be put in initializer list of st::vector<int>,</div><div><br></div><div><div>#include <vector></div><div><br></div><div>int main()</div><div>{</div>
<div> enum Type</div><div> {</div><div> None = 0x0,</div><div> A = 0x1,</div><div> B = 0x2,</div><div> C = 0x4</div><div> };</div><div><br></div><div> typedef std::vector<int> TypeVector;</div>
<div> TypeVector types = { Type::A, Type::B, Type::C };</div><div><br></div><div> return 0;</div><div>}</div></div><div><br></div><div>g++ can compile it but clang++ can't:</div><div><br></div><div><font class="Apple-style-span" face="'courier new', monospace" size="1">$ g++ -Wall -Wextra -std=c++0x ./classes_vector.cpp</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace" size="1"><br></font></div><div><div><font class="Apple-style-span" face="'courier new', monospace" size="1">$ clang++ -Wall -Wextra -std=c++0x -stdlib=libc++ ./classes_vector.cpp </font></div>
<div><font class="Apple-style-span" face="'courier new', monospace" size="1">./classes_vector.cpp:14:14: error: non-aggregate type 'TypeVector' (aka 'vector<int>') cannot be initialized with an initializer list</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace" size="1"> TypeVector types = { Type::A, Type::B, Type::C };</font></div><div><font class="Apple-style-span" face="'courier new', monospace" size="1"> ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace" size="1">1 error generated.</font></div></div><div><font class="Apple-style-span" face="'courier new', monospace" size="1"><br></font></div>
<div><font class="Apple-style-span" face="arial, helvetica, sans-serif">Could this be clang bug?</font></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif"><br></font></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif">Thanks,</font></div>
<div><font class="Apple-style-span" face="arial, helvetica, sans-serif"><br></font></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif">Ryuta</font></div>