Remove outermost loop parameter.
[official-gcc/graphite-test-results.git] / gcc / testsuite / g++.dg / cpp0x / trailing3.C
blob82d36f0d0d2e2d77a26be94194a16dd73e396d18
1 // More auto/decltype mangling tests.
2 // { dg-options "-std=c++0x" }
4 template <class T>
5 struct B
7   static int i;
8 };
10 int&& x();
12 template <class T>
13 struct A
15   static int i;
16   static int &ir;
17   static int &&irr;
18   template <class U>
19   auto f(U u) -> decltype (u + i);
20   template <class U>
21   auto fr(U u) -> decltype (u + ir);
22   template <class U>
23   auto frr(U u) -> decltype (u + irr);
24   template <class U>
25   auto g(U u) -> decltype (u + sizeof (i));
26   template <class U>
27   auto h(U u) -> decltype (u + B<U>::i);
28   template <class U>
29   auto j(U u) -> decltype (u + x());
32 template<class T> template<class U>
33 auto A<T>::f(U u) -> decltype (u + i)
35   return u + i;
38 template <class... Args>
39 int f (Args... args);
41 template <class... Args>
42 auto g (Args... args) -> decltype (f ((args+1)...))
44   return (f ((args+1)...));
47 int main()
49   // { dg-final { scan-assembler  "_ZN1AIiE1fIiEEDTplfp_L_ZNS0_1iEEET_" } }
50   A<int>().f(1);
51   // { dg-final { scan-assembler  "_ZN1AIiE2frIiEEDTplfp_L_ZNS0_2irEEET_" } }
52   A<int>().fr(1);
53   // { dg-final { scan-assembler  "_ZN1AIiE3frrIiEEDTplfp_L_ZNS0_3irrEEET_" } }
54   A<int>().frr(1);
55   // { dg-final { scan-assembler  "_ZN1AIiE1gIiEEDTplfp_szL_ZNS0_1iEEET_" } }
56   A<int>().g(1);
57   // { dg-final { scan-assembler  "_ZN1AIiE1hIiEEDTplfp_sr1BIT_E1iES3_" } }
58   A<int>().h(1);
59   // { dg-final { scan-assembler  "_ZN1AIiE1jIiEEDTplfp_clL_Z1xvEEET_" } }
60   A<int>().j(1);
61   // { dg-final { scan-assembler  "_Z1gIIidEEDTcl1fspplfp_Li1EEEDpT_" } }  
62   g(42, 1.0);