From 536c535cb0cf245a1785d436b0662f7fe59ef1e4 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Fri, 16 Jan 2015 19:21:36 +0100 Subject: [PATCH] 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 has identical arguments. 1 Error(s) detected. Implement a preprocessor test for using the partial specialization workaround needed by GNU 4.6. --- .../cxx_variadic_templates.cpp | 27 ++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/Tests/CompileFeatures/cxx_variadic_templates.cpp b/Tests/CompileFeatures/cxx_variadic_templates.cpp index a80e157e6..e1f641b81 100644 --- a/Tests/CompileFeatures/cxx_variadic_templates.cpp +++ b/Tests/CompileFeatures/cxx_variadic_templates.cpp @@ -1,5 +1,23 @@ +#if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) < 407) +#define OLD_GNU +#endif + +#ifdef OLD_GNU template struct Interface; +#endif + +template +struct Interface +#ifdef OLD_GNU + +#endif +{ + static int accumulate() + { + return I + Interface::accumulate(); + } +}; template struct Interface @@ -10,15 +28,6 @@ struct Interface } }; -template -struct Interface -{ - static int accumulate() - { - return I + Interface::accumulate(); - } -}; - // Note: split this into a separate test if a // cxx_variadic_template_template_parameters feature is added.