Merge from trunk @ 138209
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / defaulted1.C
blobe8fe37eb39a45db793b07ccf054c962462bd173b
1 // Positive test for defaulted/deleted fns
2 // { dg-do run }
3 // { dg-options "-std=c++0x" }
5 struct A
7   int i;
8   A() = default;
9   A(const A&) = delete;
10   A& operator=(const A&) = default;
11   ~A();
14 A::~A() = default;
16 void f() = delete;
18 struct B
20   int i;
21   B() = default;
24 int main()
26   A a1, a2;
27   B b = {1};
28   a1 = a2;
31 // fns defaulted in class defn are trivial
32 struct C
34   C() = default;
35   C(const C&) = default;
36   C& operator=(const C&) = default;
37   ~C() = default;
40 union U
42   C c;