aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/init/array55.C
blob: 70fb183b897f67e9f3da8ca3e55832aeab5f323f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* PR c++/90938 - Initializing array with {1} works, but not {0}
   { dg-do compile { target c++11 } } */

struct A
{
  A () = delete;
  A (int) = delete;
};

A a_[] = { 0 };            // { dg-error "use of deleted function 'A::A\\\(int\\\)'" }

A a1[1] = { 0 };           // { dg-error "use of deleted function 'A::A\\\(int\\\)'" }


struct B
{
  B () = delete;
  B (int) = delete;
  B (long);
};

B b_[] = { 0 };            // { dg-error "use of deleted function 'B::B\\\(int\\\)'" }

B b1[1] = { 0 };           // { dg-error "use of deleted function 'B::B\\\(int\\\)'" }

B b2[] = { 0L };
B b3[1] = { 0L };