| 1 |
// { dg-do compile { target c++17 } } |
| 2 |
// { dg-skip-if "requires hosted libstdc++ for vector" { ! hostedlib } } |
| 3 |
|
| 4 |
#include <vector> |
| 5 |
|
| 6 |
template<class T> struct container { |
| 7 |
container(T t) {} |
| 8 |
template<class Iter> container(Iter beg, Iter end); |
| 9 |
}; |
| 10 |
template<class Iter> |
| 11 |
container(Iter b, Iter e) // { dg-message "iterator_traits.int" } |
| 12 |
-> container<typename std::iterator_traits<Iter>::value_type>; |
| 13 |
std::vector<double> v = { /* ... */ }; |
| 14 |
container c(7); // OK, deduces int for T |
| 15 |
auto d = container(v.begin(), v.end()); // OK, deduces double for T |
| 16 |
container e{5, 6}; // { dg-error "" } int is not an iterator |