https://bugs.llvm.org/show_bug.cgi?id=32046
Bug ID: 32046
Summary: false positive for -Wunused-member-function when in
anonymous namespace
Product: clang
Version: 3.9
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: C++
Assignee: unassignedclangb...@nondot.org
Reporter: we...@wsoptics.de
CC: dgre...@apple.com, llvm-bugs@lists.llvm.org
Compiling the following code with -Wunused-member-function results in two
warnings. Removing the anonymous namespace around the definition of class
Iterator makes the warnings go away.
#include <iostream>
#include <iterator>
#include <boost/iterator/iterator_categories.hpp>
#include <boost/iterator/iterator_facade.hpp>
namespace {
class Iterator : public boost::iterator_facade<Iterator, std::size_t
const, boost::bidirectional_traversal_tag>
{
public:
Iterator() : pos_(0) {}
std::size_t dereference() const { return pos_; }
bool equal(Iterator const & other) const { return pos_ ==
other.pos_; }
void increment() { ++pos_; }
void decrement() { --pos_; }
private:
friend class boost::iterator_core_access;
std::size_t pos_;
};
}
int main()
{
Iterator i;
std::cout << "i = " << *i << '\n';
return 0;
}
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs