Features: Adjust cxx_variadic_templates unit test for SolarisStudio.
The change in commit 1f19ac4d
(Features: Adjust cxx_variadic_templates
unit test for GNU < 4.7., 2015-01-11) pacified GNU 4.6, but leaves
SolarisStudio 12.4 complaining:
"cxx_variadic_templates.cpp", line 5: Error: Partial specialization for Interface<Is...> has identical arguments.
1 Error(s) detected.
Implement a preprocessor test for using the partial specialization
workaround needed by GNU 4.6.
This commit is contained in:
parent
5d57970dd9
commit
536c535cb0
|
@ -1,5 +1,23 @@
|
|||
#if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) < 407)
|
||||
#define OLD_GNU
|
||||
#endif
|
||||
|
||||
#ifdef OLD_GNU
|
||||
template<int... Is>
|
||||
struct Interface;
|
||||
#endif
|
||||
|
||||
template<int I, int... Is>
|
||||
struct Interface
|
||||
#ifdef OLD_GNU
|
||||
<I, Is...>
|
||||
#endif
|
||||
{
|
||||
static int accumulate()
|
||||
{
|
||||
return I + Interface<Is...>::accumulate();
|
||||
}
|
||||
};
|
||||
|
||||
template<int I>
|
||||
struct Interface<I>
|
||||
|
@ -10,15 +28,6 @@ struct Interface<I>
|
|||
}
|
||||
};
|
||||
|
||||
template<int I, int... Is>
|
||||
struct Interface<I, Is...>
|
||||
{
|
||||
static int accumulate()
|
||||
{
|
||||
return I + Interface<Is...>::accumulate();
|
||||
}
|
||||
};
|
||||
|
||||
// Note: split this into a separate test if a
|
||||
// cxx_variadic_template_template_parameters feature is added.
|
||||
|
||||
|
|
Loading…
Reference in New Issue