aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/class-deduction-aggr11.C
blob: c4806de56af85b1910510ca19d36e17e37095fdb (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
28
29
// PR c++/101344
// { dg-do compile { target c++20 } }

template<class T=void>
struct A { int m; int t[2]; };

A a1{1, {2, 3}}; // previously rejected
A a2{1, 2, 3};

struct B { int x, y; };

template<class T=void>
struct C { int m; struct { int x, y; } t; };

A b1{1, {2, 3}}; // previously rejected
A b2{1, 2, 3};

template<class T>
struct D { T t[2]; };

D d1{1, 2};
D d2{{1, 2}}; // previously rejected

template<class T>
struct E { T t[2][2]; };

E e1{1, 2, 3, 4};
E e2{{{1, 2}, {3, 4}}}; // previously rejected
E e3{{1, 2, 3, 4}}; // { dg-error "deduction|no match" }