// { dg-do compile { target c++17 } } #include template struct container { container(T t) {} template container(Iter beg, Iter end); }; template container(Iter b, Iter e) // { dg-message "iterator_traits.int" } -> container::value_type>; std::vector v = { /* ... */ }; container c(7); // OK, deduces int for T auto d = container(v.begin(), v.end()); // OK, deduces double for T container e{5, 6}; // { dg-error "" } int is not an iterator