File: decomp7.C

package info (click to toggle)
gcc-arm-none-eabi 15%3A14.2.rel1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,099,328 kB
  • sloc: cpp: 3,627,108; ansic: 2,571,498; ada: 834,230; f90: 235,082; makefile: 79,231; asm: 74,984; xml: 51,692; exp: 39,736; sh: 33,298; objc: 15,629; python: 15,069; fortran: 14,429; pascal: 7,003; awk: 5,070; perl: 3,106; ml: 285; lisp: 253; lex: 204; haskell: 135
file content (60 lines) | stat: -rw-r--r-- 2,062 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// { dg-do run { target c++11 } }
// { dg-options "" }

int a[2] = { 1, 2 };
int b[2] = { 4, 5 };
struct S { int a; signed char b; float c; } sa = { 6, 7, 8.0f };
S sb = { 9, 10, 11.0f };

template <typename T, typename U>
void
foo (T &x, U &y)
{
  auto & [ c, d ] = a;		// { dg-warning "structured bindings only available with" "" { target c++14_down } }
  auto [ e, f ] = a;		// { dg-warning "structured bindings only available with" "" { target c++14_down } }
  auto [ g, h, i ] = sa;	// { dg-warning "structured bindings only available with" "" { target c++14_down } }
  auto & [ j, k, l ] = sa;	// { dg-warning "structured bindings only available with" "" { target c++14_down } }
  auto & [ m, n ] = x;		// { dg-warning "structured bindings only available with" "" { target c++14_down } }
  auto [ o, p ] = x;		// { dg-warning "structured bindings only available with" "" { target c++14_down } }
  auto [ q, r, s ] = y;		// { dg-warning "structured bindings only available with" "" { target c++14_down } }
  auto & [ t, u, v ] = y;	// { dg-warning "structured bindings only available with" "" { target c++14_down } }
  c += 1;
  e += 2;
  g += 3;
  j += 4;
  m += 5;
  o += 6;
  q += 7;
  t += 8;
  if (c != 2 || &c != &a[0]
      || d != 2 || &d != &a[1]
      || e != 3 || &e == &a[0]
      || f != 2 || &f == &a[1]
      || g != 9 || &g == &sa.a
      || h != 7 || &h == &sa.b
      || i != 8.0f || &i == &sa.c
      || j != 10 || &j != &sa.a
      || k != 7 || &k != &sa.b
      || l != 8.0f || &l != &sa.c
      || m != 9 || &m != &b[0]
      || n != 5 || &n != &b[1]
      || o != 10 || &o == &b[0]
      || p != 5 || &p == &b[1]
      || q != 16 || &q == &sb.a
      || r != 10 || &r == &sb.b
      || s != 11.0f || &s == &sb.c
      || t != 17 || &t != &sb.a
      || u != 10 || &u != &sb.b
      || v != 11.0f || &v != &sb.c
      || a[0] != 2 || a[1] != 2
      || sa.a != 10 || sa.b != 7 || sa.c != 8.0f
      || b[0] != 9 || b[1] != 5
      || sb.a != 17 || sb.b != 10 || sb.c != 11.0f)
    __builtin_abort ();
}

int
main ()
{
  foo (b, sb);
}