repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
PR c++/84874
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
cpp2a
/
desig7.C
blob
2865014f591f854072bde08c7114f1f1cb1f0372
1
// PR c++/84874
2
// { dg-do run { target c++11 } }
3
// { dg-options "" }
4
5
struct A { int a, b; };
6
struct B { A d; };
7
8
void
9
foo (B *x)
10
{
11
*x = { .d = { .b = 5 } };
12
}
13
14
void
15
bar (A *x)
16
{
17
*x = { .b = 6 };
18
}
19
20
int
21
main ()
22
{
23
B b = { { 2, 3 } };
24
foo (&b);
25
if (b.d.a != 0 || b.d.b != 5)
26
__builtin_abort ();
27
b.d.a = 8;
28
bar (&b.d);
29
if (b.d.a != 0 || b.d.b != 6)
30
__builtin_abort ();
31
}