diff options
Diffstat (limited to 'Tests/CompileFeatures/cxx_variadic_templates.cpp')
-rw-r--r-- | Tests/CompileFeatures/cxx_variadic_templates.cpp | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/Tests/CompileFeatures/cxx_variadic_templates.cpp b/Tests/CompileFeatures/cxx_variadic_templates.cpp index a80e157..e1f641b 100644 --- a/Tests/CompileFeatures/cxx_variadic_templates.cpp +++ b/Tests/CompileFeatures/cxx_variadic_templates.cpp @@ -1,21 +1,30 @@ +#if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) < 407) +#define OLD_GNU +#endif + +#ifdef OLD_GNU template<int... Is> struct Interface; +#endif -template<int I> -struct Interface<I> +template<int I, int... Is> +struct Interface +#ifdef OLD_GNU + <I, Is...> +#endif { static int accumulate() { - return I; + return I + Interface<Is...>::accumulate(); } }; -template<int I, int... Is> -struct Interface<I, Is...> +template<int I> +struct Interface<I> { static int accumulate() { - return I + Interface<Is...>::accumulate(); + return I; } }; |