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
c++, coroutines: Simplify separation of the user function body and ramp.
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
cpp1y
/
constexpr-nsdmi5.C
blob
59e7a10d6e8253bac31ad7160ef60b185c2b98b2
1
// PR c++/94219
2
// { dg-do compile { target c++14 } }
3
4
struct A { long x; };
5
6
struct U;
7
constexpr A foo(U *up);
8
9
struct U {
10
U() = default;
11
int y; A a = foo(this);
12
};
13
14
constexpr A foo(U *up) {
15
up->y = 11;
16
return {42};
17
}
18
19
extern constexpr U u = {};
20
21
static_assert(u.y == 11, "");
22
static_assert(u.a.x == 42, "");