OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [cpp0x/] [variadic-ex13.C] - Blame information for rev 715

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// { dg-options "-std=gnu++0x" }
2
 
3
template struct is_same {
4
  static const bool value = false;
5
};
6
 
7
template struct is_same {
8
  static const bool value = true;
9
};
10
 
11
template struct Tuple {};
12
template struct Pair {};
13
 
14
template
15
  struct zip {
16
    template
17
    struct with {
18
      typedef Tuple...> type; // { dg-error "mismatched argument pack" }
19
    };
20
  };
21
 
22
static_assert
23
  (is_same::with::type,
24
           Tuple, Pair > >::value,
25
   "zip");
26
 
27
typedef zip::with::type T2; // error: different number of arguments specified
28
                                                             // for Args1 and Args2
29
 
30
template void f(Args...);
31
 
32
template void g(Args... args)
33
{
34
   f(const_cast(&args)...); // okay: ``Args'' and ``args'' are expanded
35
   f(5 ...); // { dg-error "contains no argument packs" }
36
   f(args); // { dg-error "parameter packs not expanded" }
37
   // { dg-message "args" "note" { target *-*-* } 36 }
38
   f(h(args...) + args...); // okay: first ``args'' expanded within h, second ``args'' expanded within f.
39
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.