1 // RUN: %clang_cc1 -std=c++1z -verify %s
3 struct A
{ int x
, y
; };
5 struct C
{ template<int> int get(); };
6 struct D
{ int x
, y
, z
; };
7 struct E
{ int *p
, n
; };
10 using size_t = decltype(sizeof(0));
11 template<typename
> struct tuple_size
;
12 template<size_t, typename
> struct tuple_element
{ using type
= int; };
15 template<> struct std::tuple_size
<C
> { enum { value
= 2 }; };
17 template<typename T
> int decomp(T
&t
) {
18 auto &[a
, b
] = t
; // expected-error {{type 'D' decomposes into 3 elements, but only 2 names were provided}}
19 return a
+ b
; // expected-error {{cannot initialize return object of type 'int' with an rvalue of type 'int *'}}
31 decomp(d
); // expected-note {{in instantiation of}}
32 decomp(e
); // expected-note {{in instantiation of}}