Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/cpp1z/class-deduction14.C @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
131 | 1 // { dg-do compile { target c++17 } } |
111 | 2 |
3 #include <vector> | |
4 | |
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 |