aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp1z/decomp54.C
blob: 1094329e69d5a2d023cf4a989980501078ad3a94 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// PR c++/97878
// { dg-do compile { target c++11 } }
// { dg-options "" }

extern int a[];
auto [b] { a };	// { dg-error "incomplete" }
		// { dg-warning "only available with" "" { target c++14_down } .-1 }
auto [c] = a;	// { dg-error "incomplete" }
		// { dg-warning "only available with" "" { target c++14_down } .-1 }
extern int d[0];
auto [e] { d };	// { dg-error "too many initializers for" }
		// { dg-error "1 name provided for structured binding" "" { target *-*-* } .-1 }
		// { dg-message "decomposes into 0 elements" "" { target *-*-* } .-2 }
		// { dg-warning "only available with" "" { target c++14_down } .-3 }
auto [f] = d;	// { dg-error "1 name provided for structured binding" }
		// { dg-message "decomposes into 0 elements" "" { target *-*-* } .-1 }
		// { dg-warning "only available with" "" { target c++14_down } .-2 }