OSDN Git Service

PR c++/51143 - Alias template allows class definition
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / cpp0x / variadic105.C
1 // PR c++/47289
2 // { dg-options -std=c++0x }
3 // { dg-prune-output "note" }
4
5 template <template <typename... __ARGS> class _F, typename... _ARGS>
6 auto reverse (_ARGS... args) -> decltype(_F<_ARGS...>::call_function(args...)) {
7   return _F<_ARGS...>::call_function(args...);
8 }
9
10 template <typename _T>
11 _T sum(_T x) { return x; }
12
13 template <typename _T, typename... _ARGS>
14 _T sum(_T x, _ARGS... args) { return x + sum(args...); }
15
16 template <typename _T, typename... _ARGS>
17 struct call_sum {
18   static _T call_function(_T x1, _ARGS... args) { return sum(x1, args...); }
19 };
20
21 int main() {
22   // This shouldn't be an error; this is bug 35722.
23   reverse<call_sum>(1,2);       // { dg-bogus "no match" "" }
24   // { dg-bogus "sorry, unimplemented" "candidate explanation" { target *-*-* } 6 }
25 }