Bug Report: Incorrect expansion of variadic lists of constants

Bug Report: Incorrect expansion of variadic lists of constants

Using Intel C++ Compiler v14.0 (latest as of the date on this post).

The following code:

template<typename uint_t, uint_t ...sig_values>
struct static_uint_array
    static const uint_t values[sizeof...(sig_values)];
template<typename uint_t, uint_t ...sig_values>
const uint_t static_uint_array<uint_t,sig_values...>::values[
    ] = {sig_values...};

...when used as...

uint32_t value = static_uint_array<uint32_t,0,1,2,3,4,5>::values[0];

...produces this error:

*snip* expected a "}"

1> ] = {sig_values...};"

Where the caret is pointing to the ellipses.

Removing the ellipses allows the code to compile, however the element list is then expanded in reverse order (that is, "value" in the example above would be 5).


2 posts / novo 0
Último post
Para obter mais informações sobre otimizações de compiladores, consulte Aviso sobre otimizações.


I can reproduce this problem (using the /Qstd=c++11 switch) on Windows, it works as expected with our Linux compiler.

I have submitted a defect report for this in our bug tracking database as DPD200248043. Thank you for bringing this to our attention.


Deixar um comentário

Faça login para adicionar um comentário. Não é membro? Inscreva-se hoje mesmo!