2018-11-07 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / g++.dg / cpp1z / class-deduction14.C
blobba2ba9bd1ec164c65390f6ac9f768cb0d8c0782d
1 // { dg-do compile { target c++17 } }
3 #include <vector>
5 template<class T> struct container {
6   container(T t) {}
7   template<class Iter> container(Iter beg, Iter end);
8 };
9 template<class Iter>
10 container(Iter b, Iter e)       // { dg-message "iterator_traits.int" }
11   -> container<typename std::iterator_traits<Iter>::value_type>;
12 std::vector<double> v = { /* ... */ };
13 container c(7);           // OK, deduces int for T
14 auto d = container(v.begin(), v.end()); // OK, deduces double for T
15 container e{5, 6};              // { dg-error "" } int is not an iterator