summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp1z/class-deduction14.C
blob: 1c7e34e17c6cbe5316bb590ca2201959a08e6f37 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// { dg-options -std=c++1z }

#include <vector>

template<class T> struct container {
  container(T t) {}
  template<class Iter> container(Iter beg, Iter end);
};
template<class Iter>
container(Iter b, Iter e)	// { dg-message "iterator_traits.int" }
  -> container<typename std::iterator_traits<Iter>::value_type>;
std::vector<double> 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