lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi] Unused parameter warning from clang after diagnostic simplificatio


From: Vadim Zeitlin
Subject: [lmi] Unused parameter warning from clang after diagnostic simplification
Date: Wed, 11 Jan 2017 22:43:02 +0100

 Hi,

 This is trivial but prevents me from building the latest master with clang
because it results in -Wunused-parameter which is fatal in conjunction with
-Werror, e.g.

---------------------------------- >8 --------------------------------------
numeric_io_cast.hpp:123:31: error: unused parameter 'from' 
[-Werror,-Wunused-parameter]
    To operator()(From const& from) const
                              ^
1 error generated.
---------------------------------- >8 --------------------------------------

Unlike gcc, clang seems to check for the unused parameters even in the
functions which are never instantiated (AFAICS). I'm not sure which
behaviour is better, but it doesn't seem useful to have this parameter name
in any case, so could you please apply the following patch to fix this
recent regression (see cbd94a722917b617b2ad72247313bd24e397e5e4):
---------------------------------- >8 --------------------------------------
diff --git a/numeric_io_cast.hpp b/numeric_io_cast.hpp
index aa7306f..1c6b384 100644
--- a/numeric_io_cast.hpp
+++ b/numeric_io_cast.hpp
@@ -120,7 +120,7 @@ struct numeric_converter
     static_assert(std::is_void<To  >::value, "");
     static_assert(std::is_void<From>::value, "");

-    To operator()(From const& from) const
+    To operator()(From const&) const
         {
         throw std::logic_error("Impossible numeric conversion.");
         }
---------------------------------- >8 --------------------------------------

 Thanks in advance!
VZ


reply via email to

[Prev in Thread] Current Thread [Next in Thread]