Opened 7 years ago
Closed 7 years ago
#11241 closed Bugs (fixed)
unused parameter warnings in operator<< in boost::optional with clang++
| Reported by: | Owned by: | akrzemi1 | |
|---|---|---|---|
| Milestone: | Boost 1.59.0 | Component: | optional | 
| Version: | Boost 1.58.0 | Severity: | Problem | 
| Keywords: | Cc: | 
Description
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.
Change History (2)
comment:1 by , 7 years ago
| Milestone: | To Be Determined → Boost 1.59.0 | 
|---|---|
| Owner: | changed from to | 
comment:2 by , 7 years ago
| Resolution: | → fixed | 
|---|---|
| Status: | new → closed | 
  Note:
 See   TracTickets
 for help on using tickets.
    
