Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/g++.dg/cpp0x/fntmpdefarg10.C @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
111:04ced10e8804 | 131:84e7813d76e9 |
---|---|
1 // PR c++/85765 | |
2 // { dg-do compile { target c++11 } } | |
3 | |
4 struct il { il(); il(const il&); }; | |
5 | |
6 int* begin(il); | |
7 | |
8 template<class T> T&& declval(); | |
9 | |
10 template<class T, class U = decltype(begin(declval<T&>())), decltype(*U(),0) = 0> | |
11 U g(T& t, long) { return begin(t); } // #1 | |
12 | |
13 template<class T> | |
14 int g(T& t, ...); // #2 | |
15 | |
16 volatile il a; | |
17 | |
18 auto n = g(a, 0); // calls #1 and ends with a hard error, should call #2 |