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++/56973, DR 696 - capture constant variables only as needed.
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
cpp1y
/
nsdmi-aggr5.C
blob
fe377c399c806f8d98be417501f075fc673e8bec
1
// PR c++/70332
2
// { dg-do run { target c++14 } }
3
4
template <class T>
5
struct C
6
{
7
T m;
8
T *n = &m;
9
};
10
11
C<int> c { };
12
13
int
14
main ()
15
{
16
*c.n = 5;
17
if (c.m != 5)
18
__builtin_abort ();
19
20
C<int> d { 10 };
21
*d.n = *d.n + 1;
22
if (d.m != 11)
23
__builtin_abort ();
24
}