Features: Adjust cxx_variadic_templates unit test for GNU < 4.7.

The unit test for this fails with GNU 4.6:

 Building CXX object CMakeFiles/test_cxx_variadic_templates.dir/cxx_variadic_templates.cpp.o
   CompileFeatures/cxx_variadic_templates.cpp: In static member function ‘static int Interface<I, Is>::accumulate()’:
   CompileFeatures/cxx_variadic_templates.cpp:18:31: sorry, unimplemented: cannot expand ‘Is ...’ into a fixed-length argument list
 CMakeFiles/test_cxx_variadic_templates.dir/build.make:54: recipe for target 'CMakeFiles/test_cxx_variadic_templates.dir/cxx_variadic_templates.cpp.o' failed

The workaround is to use a specialization:

 http://stackoverflow.com/questions/1989552
 http://stackoverflow.com/questions/11297376
This commit is contained in:
Stephen Kelly 2015-01-11 18:44:49 +01:00
parent 0798d1e5b0
commit 1f19ac4da5
1 changed files with 2 additions and 2 deletions

View File

@ -1,4 +1,4 @@
template<int I, int... Is>
template<int... Is>
struct Interface;
template<int I>
@ -11,7 +11,7 @@ struct Interface<I>
};
template<int I, int... Is>
struct Interface
struct Interface<I, Is...>
{
static int accumulate()
{