[Boost-bugs] [Boost C++ Libraries] #11241: unused parameter warnings in operator<< in boost::optional with clang++

Subject: [Boost-bugs] [Boost C++ Libraries] #11241: unused parameter warnings in operator<< in boost::optional with clang++
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-04-24 20:46:23


#11241: unused parameter warnings in operator<< in boost::optional with clang++
--------------------------------------+-----------------------
 Reporter: Moritz Bunkus <moritz@…> | Owner: fcacciola
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: optional
  Version: Boost 1.58.0 | Severity: Problem
 Keywords: |
--------------------------------------+-----------------------
 Trivial example program:

 {{{
 #include <boost/optional.hpp>

 int
 main(int, char *[]) {
   boost::optional<int> i;
 }
 }}}

 Compile with clang++:

 {{{
 clang++ -Wall -Wextra -Wno-unused-local-typedefs \
   -I$HOME/opt/boost/boost_1_58_0/include/ \
   -L$HOME/opt/boost/boost_1_58_0/lib/ -o cpp2 cpp2.cpp
 }}}

 Output:

 {{{
 In file included from cpp2.cpp:1:
 In file included from
 /home/mosu/opt/boost/boost_1_58_0/include/boost/optional.hpp:15:
 /home/mosu/opt/boost/boost_1_58_0/include/boost/optional/optional.hpp:1254:53:
 warning: unused parameter 'out' [-Wunused-parameter]
 operator<<(std::basic_ostream<CharType, CharTrait>& out,
 optional_detail::optional_tag const& v)
                                                     ^
 /home/mosu/opt/boost/boost_1_58_0/include/boost/optional/optional.hpp:1254:95:
 warning: unused parameter 'v' [-Wunused-parameter]
 operator<<(std::basic_ostream<CharType, CharTrait>& out,
 optional_detail::optional_tag const& v)
 ^
 2 warnings generated.
 }}}

 This is a regression from 1.57.0 where no such warnings were emitted.

 clang++ 3.6.0 emits warnings with 1.58.0 but not with 1.57.0.

 g++ 4.9.2 emits warnings with neither of those versions.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/11241>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:18 UTC