Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/g++.dg/cpp0x/variadic180.C @ 152:2b5abeee2509
update gcc11
author | anatofuz |
---|---|
date | Mon, 25 May 2020 07:50:57 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
145:1830386684a0 | 152:2b5abeee2509 |
---|---|
1 // PR c++/94628 | |
2 // A variant of variadic101.C where the recursive call to deref | |
3 // has its first template argument explicitly provided. | |
4 // { dg-do compile { target c++11 } } | |
5 | |
6 template<class T> | |
7 struct Container | |
8 { T f() const; }; | |
9 | |
10 template<class T> | |
11 T deref(const T& t) | |
12 { return t; } | |
13 | |
14 | |
15 template <class T, class... Args> | |
16 auto | |
17 deref(const T& u, int r, Args... args) | |
18 -> decltype(deref(u.f(), args...)) | |
19 { return deref<decltype(u.f())>(u.f(), args...); } | |
20 | |
21 int main(void) | |
22 { | |
23 Container<Container<int>> v; | |
24 deref(v,1,2); | |
25 } |