| 1 |
// PR c++/101988 |
| 2 |
// { dg-do compile { target c++17 } } |
| 3 |
|
| 4 |
template<typename T> |
| 5 |
struct A { |
| 6 |
A(T); |
| 7 |
A(); |
| 8 |
}; |
| 9 |
auto p1 = new A[]{1}; // { dg-error "creating array of template placeholder type" } |
| 10 |
auto p2 = new A[1]{1}; // { dg-error "invalid use of placeholder" } |
| 11 |
auto p3 = new A<int>[]{1}; |
| 12 |
auto p4 = new A<int>[1]{1}; |
| 13 |
auto p5 = new A[]{1, 2}; // { dg-error "creating array of template placeholder type" } |
| 14 |
auto p6 = new A<int>[]{1, 2}; |
| 15 |
auto p7 = new A<int>[]{A(1), A(1)}; |
| 16 |
auto p8 = new A<int>[2]{A(1), A(1)}; |