PR c++/86728 - C variadic generic lambda.
[official-gcc.git] / gcc / testsuite / g++.dg / pr85478.C
blob4eb4f2487c9aeaaf98239493831adc0426b973e4
1 /* { dg-do compile { target { s390*-*-* } } } */
2 /* { dg-options "-O3 -march=arch12 -std=c++11 -Wno-return-type" } */
4 struct a {
5   enum { b };
6 };
7 struct c {
8   template <typename d, typename e> static void f(d g, e h) {
9     d i;
10     for (; i != g; ++h, ++i)
11       *h = *i;
12   }
14 template <int, typename d, typename e> void j(d g, e h) { c::f(g, h); }
15 template <int k, typename d, typename e> void l(d g, e h) { j<k>(g, h); }
16 template <typename d, typename e> void aa(d g, e h) { l<a::b>(g, h); }
17 template <typename> class ab;
18 template <> struct ab<float> {
19   _Complex m() { return n; }
20   _Complex n;
22 template <> struct ab<long double> {
23   ab(ab<float> g) : n(g.m()) {}
24   _Complex long double n;
26 template <int ac, typename o> class p {
27 public:
28   template <typename q> p &operator=(const p<ac, q> &);
29   o *ad;
31 template <typename o> class r : public p<2, o> {};
32 template <int ac, typename o>
33 template <typename q>
34 p<ac, o> &p<ac, o>::operator=(const p<ac, q> &g) {
35   aa(&g.ad[0], &ad[0]);
37 template <typename ae> class s : public r<ae> {
38   template <typename t> s &operator=(const s<t> &);
40 template <typename ae>
41 template <typename t>
42 s<ae> &s<ae>::operator=(const s<t> &g) {
43   p<2, ae>::operator=(g);
45 template s<ab<long double>> &s<ab<long double>>::
46 operator=(const s<ab<float>> &);