annotate gcc/testsuite/g++.dg/cpp1z/class-deduction14.C @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children 84e7813d76e9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 // { dg-options -std=c++17 }
kono
parents:
diff changeset
2
kono
parents:
diff changeset
3 #include <vector>
kono
parents:
diff changeset
4
kono
parents:
diff changeset
5 template<class T> struct container {
kono
parents:
diff changeset
6 container(T t) {}
kono
parents:
diff changeset
7 template<class Iter> container(Iter beg, Iter end);
kono
parents:
diff changeset
8 };
kono
parents:
diff changeset
9 template<class Iter>
kono
parents:
diff changeset
10 container(Iter b, Iter e) // { dg-message "iterator_traits.int" }
kono
parents:
diff changeset
11 -> container<typename std::iterator_traits<Iter>::value_type>;
kono
parents:
diff changeset
12 std::vector<double> v = { /* ... */ };
kono
parents:
diff changeset
13 container c(7); // OK, deduces int for T
kono
parents:
diff changeset
14 auto d = container(v.begin(), v.end()); // OK, deduces double for T
kono
parents:
diff changeset
15 container e{5, 6}; // { dg-error "" } int is not an iterator