diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/init/array55.C')
-rw-r--r-- | gcc/testsuite/g++.dg/init/array55.C | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/init/array55.C b/gcc/testsuite/g++.dg/init/array55.C new file mode 100644 index 00000000000..70fb183b897 --- /dev/null +++ b/gcc/testsuite/g++.dg/init/array55.C @@ -0,0 +1,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 }; |