Opened 7 years ago

Closed 7 years ago

#11239 closed Bugs (duplicate)

clang++ emits lots of warnings about unused local defines

Reported by: Moritz Bunkus <moritz@…> Owned by:
Milestone: To Be Determined Component: None
Version: Boost 1.58.0 Severity: Regression
Keywords: Cc:

Description

When compiling anything using BOOST_RANGE_CONCEPT_ASSERT() cland++ emits tons of warnings about used local defines with -Wall.

This is a regression compared to 1.57.0.

Trivial example program:

#include <vector>
#include <boost/range/algorithm.hpp>

int
main(int, char**) {
  std::vector<int> v;
  boost::range::sort(v);
}

Compiled with:

clang++ -Wall -I$HOME/opt/boost/boost_1_58_0/include/ \
  -L$HOME/opt/boost/boost_1_58_0/lib/ -o cpp1 cpp1.cpp

Output (excerpt):

In file included from cpp1.cpp:46:
In file included from /home/mosu/opt/boost/boost_1_58_0/include/boost/range/algorithm.hpp:29:
In file included from /home/mosu/opt/boost/boost_1_58_0/include/boost/range/concepts.hpp:19:
/home/mosu/opt/boost/boost_1_58_0/include/boost/concept_check.hpp:51:7: warning: unused typedef 'boost_concept_check51' [-Wunused-local-typedef]
      BOOST_CONCEPT_ASSERT((Model));
…
313 warnings generated.

These are 313 warnings for that trivial example program above.

g++ 4.9.2 does not emit such warnings, with neither version.

clang++ 3.6.0 emits those warnings with Boost 1.58.0 but not with 1.57.0 or earlier.

Change History (2)

comment:1 by Moritz Bunkus <moritz@…>, 7 years ago

I'm sorry to have opened two tickets (this one and #11240). The server takes way too long after clicking on »submit«, therefore I went back, changed »defines« to »typedefs« and re-submitted. Hence two bugs. Feel free to close one of them, preferably this one as the wording in #11240 is better.

comment:2 by viboes, 7 years ago

Resolution: duplicate
Status: newclosed
Note: See TracTickets for help on using tickets.