2018-11-07 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / g++.dg / cpp1z / decomp38.C
blob769318e89763a8318581d3f26b699809f6634c08
1 // { dg-do compile { target c++17 } }
3 class X
5    int a, b;
6    void f()
7    {
8      auto[x,y] = *this;
9    }
12 class X2
14    int a, b;
15    void f(X2& other)
16    {
17      auto[x,y] = other;
18    }
21 struct X3
23   friend void foo();
24 private:
25   int a;
28 void foo()
30   X3 x;
31   auto [a] = x;
34 struct X4
36   int a;
39 struct X5 : private X4
41   friend void foo2();
44 void foo2() {
45   X5 x;
46   auto [a] = x;