https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63500
Bug ID: 63500
Summary: bug in debug version of std::make_move_iterator?
Product: gcc
Version: 5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: vermaelen.wouter at gmail dot com
Is the following a bug in the debug version of std::make_move_iterator or is it
a bug in my code? It compiles fine with older gcc versions (both debug and
non-debug). But when using a fairly recent gcc-5.0 snapshot it fails to compile
when using -D_GLIBCXX_DEBUG, non-debug mode works fine.
---- 8< -------- 8< -------- 8< -------- 8< -------- 8< ----
// Compiles fine with:
// g++-4.8 -std=c++11 -c -D_GLIBCXX_DEBUG bug.cc
// g++-snapshot -std=c++11 -c bug.cc
// But this fails:
// g++-snapshot -std=c++11 -c -D_GLIBCXX_DEBUG bug.cc
#include <iterator>
#include <memory>
#include <vector>
class Foo {};
std::vector<std::unique_ptr<Foo>> v;
std::vector<std::unique_ptr<Foo>> w;
void test() {
v.insert(end(v),
make_move_iterator(begin(w)),
make_move_iterator(end (w)));
}