brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · 40d843e Raw
26 lines · cpp
1// RUN: %clang_cc1 -std=c++2c -verify -fsyntax-only %s2 3template <unsigned N>4void decompose_array() {5  int arr[4] = {1, 2, 3, 5};6  auto [x, ... // #17    rest, ...more_rest] = arr; // expected-error{{multiple packs in structured binding declaration}}8                               // expected-note@#1{{previous binding pack specified here}}9 10  auto [y...] = arr; // expected-error{{'...' must immediately precede declared identifier}}11 12  auto [...] = arr; // #213                    // expected-error@#2{{expected identifier}}14                    // expected-error@#2{{{no names were provided}}}15                    // expected-warning@#2{{{does not allow a structured binding group to be empty}}}16  auto [a, ..., b] = arr; // #317                          // expected-error@#3{{expected identifier}}18                          // expected-error@#3{{{only 1 name was provided}}}19  auto [a1, ...] = arr; // #420                        // expected-error@#4{{expected identifier}}21                        // expected-error@#4{{{only 1 name was provided}}}22  auto [..., b] = arr; // #523                       // expected-error@#5{{expected identifier}}24                       // expected-error@#5{{{no names were provided}}}25}26