1 // RUN: %clang_cc1 -std=c++1z -verify %s
2 
3 int array() {
4   static int arr[3] = {};
5   // FIXME: We are supposed to create an array object here and perform elementwise initialization.
6   auto [a, b, c] = arr; // expected-error {{cannot decompose non-class, non-array}}
7 
8   auto &[d, e] = arr; // expected-error {{type 'int [3]' decomposes into 3 elements, but only 2 names were provided}}
9   auto &[f, g, h, i] = arr; // expected-error {{type 'int [3]' decomposes into 3 elements, but 4 names were provided}}
10 
11   auto &[r0, r1, r2] = arr;
12   const auto &[cr0, cr1, cr2] = arr;
13 
14   static_assert(&arr[0] == &r0);
15   static_assert(&arr[0] == &cr0);
16 
17   using T = int;
18   using T = decltype(r0);
19   using U = const int;
20   using U = decltype(cr0);
21 
22   return r1 + cr2;
23 }
24