Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7954 Discussions

error: parameter pack was referenced but not expanded

Paul_P_5
Beginner
1,089 Views

This is a C++ compiler bug report. (If it should be submitted elsewhere let me know.)

With Intel C++ (2016.0.109) the following error is reported:

$ icpc -std=c++11 icpc-bug.cxx
icpc-bug.cxx(12): error: parameter pack "TS" was referenced but not expanded
  template <typename... TS, TS... vals>
                            ^

compilation aborted for icpc-bug.cxx (code 2)
zsh: exit 2     icpc -std=c++11 icpc-bug.cxx
$

with this code (which distilled to a small program that recreates the bug):

template <typename T, T value>
struct bar
{
};

template <typename... T>
struct foo
{
  using type = bool;
};

template <typename... TS, TS... vals>
struct foo<bar<TS,vals>...>
{
  using type = bool;
};


int main()
{
  foo<bar<int, 1>, bar<long, 3L>> f;
}

This code is correct C++ and compiles with clang v3.5.0 and GCC (v4.8.x through to and v6 - 20150830).

0 Kudos
2 Replies
Amanda_S_Intel
Employee
1,089 Views

Thanks for the test case. I reproduced this with icpc 16.0 and g++ 4.9.0 and I submitted this issue to the development team (DPD200376943). 

0 Kudos
Paul_P_5
Beginner
1,089 Views

Any news if this issue has been fixed yet?

0 Kudos
Reply