Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/cpp1z/class-deduction14.C @ 158:494b0b89df80 default tip
...
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 25 May 2020 18:13:55 +0900 |
parents | 84e7813d76e9 |
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 |