From bea4a67c923571a817aef20b186f22aab7f779eb Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Sat, 22 Jun 2013 10:51:45 +0200 Subject: [PATCH] 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 --- test/main.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 { typedef float type; }; template struct GetDifferentType > { typedef std::complex::type> type; }; -template static std::string type_name() { return "other"; } +// Forward declaration to avoid ICC warning +template std::string type_name(); +template std::string type_name() { return "other"; } template<> std::string type_name() { return "float"; } template<> std::string type_name() { return "double"; } template<> std::string type_name() { return "int"; }