[Bug c++/84283] std::map::insert(const_iterator, P&&) now ambiguous with std::map::insert(InputIterator, InputIterator)

2018-02-08 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84283

Jonathan Wakely  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-02-08
 Ever confirmed|0   |1

--- Comment #3 from Jonathan Wakely  ---
Thanks. And again with no library dependency:

template struct enable_if { };
template struct enable_if { using type = T; };

template struct trait { static constexpr bool value = false; };

template
struct map {
template::value>::type>
void insert(void * pos, Pair&& x);

template
void insert(Iterator first, Iterator last);
};

template
struct map_type_to_map : map {
void add() {
void * ptr = 0;
map current_values;
current_values.insert(ptr, ptr);
}
};

[Bug c++/84283] std::map::insert(const_iterator, P&&) now ambiguous with std::map::insert(InputIterator, InputIterator)

2018-02-08 Thread lh_mouse at 126 dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84283

--- Comment #2 from Liu Hao  ---
Ditto, but even more reduced:


--

#include 

template
struct map {
template::value>::type>
void * insert(void * pos, Pair&& x);

template
void insert(Iterator first, Iterator last);
};

template
struct map_type_to_map : map {
void add() {
void * ptr = 0;
map current_values;
current_values.insert(ptr, ptr);
}
};

[Bug c++/84283] std::map::insert(const_iterator, P&&) now ambiguous with std::map::insert(InputIterator, InputIterator)

2018-02-08 Thread lh_mouse at 126 dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84283

Liu Hao  changed:

   What|Removed |Added

 CC||lh_mouse at 126 dot com

--- Comment #1 from Liu Hao  ---
This is a reduced testcase, which compiles fine using clang++ HEAD:




--

#include 

template
struct pair {
F first;
S second;
pair(F, S);
};

template
struct map {
using value_type = pair;
using const_iterator = const value_type *;
using iterator = value_type *;

const_iterator begin() const;
const_iterator end() const;

template::value>::type>
iterator insert(const_iterator pos, Pair&& x);

template
void insert(Iterator first, Iterator last);
};

template
struct map_type_to_map : map {
void add() {
map current_values, values;
current_values.insert(values.begin(), values.end());
}
};