aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/main.h
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2013-06-22 10:51:45 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2013-06-22 10:51:45 +0200
commitbea4a67c923571a817aef20b186f22aab7f779eb (patch)
treef8afdc5fdef8f3b781c5fa6b67f401f382181931 /test/main.h
parent260a92333426f4610e7f5ed3fc5f4d18882671ee (diff)
that's getting harder and harder to make ICC, GCC and clang all happy: one wants type_name to be static and if it is so then the other one triggers 'unused function' warnings -> a forward declaration seems to do the trick
Diffstat (limited to 'test/main.h')
-rw-r--r--test/main.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/main.h b/test/main.h
index 6db976073..93163c3cb 100644
--- a/test/main.h
+++ b/test/main.h
@@ -377,7 +377,9 @@ template<> struct GetDifferentType<double> { typedef float type; };
template<typename T> struct GetDifferentType<std::complex<T> >
{ typedef std::complex<typename GetDifferentType<T>::type> type; };
-template<typename T> static std::string type_name() { return "other"; }
+// Forward declaration to avoid ICC warning
+template<typename T> std::string type_name();
+template<typename T> std::string type_name() { return "other"; }
template<> std::string type_name<float>() { return "float"; }
template<> std::string type_name<double>() { return "double"; }
template<> std::string type_name<int>() { return "int"; }