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
/cp
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
cpp1y
/
constexpr-void2.C
blob
321a35ed29ba4c861d883d11b9fa99bdb33bf6c1
1
// PR c++/64547
2
// { dg-do compile { target c++14 } }
3
4
struct X
5
{
6
int x;
7
constexpr int get() const {return x;}
8
constexpr void set(int foo) {x = foo;}
9
};
10
11
constexpr int bar()
12
{
13
X x{42};
14
x.set(666);
15
return x.get();
16
}
17
18
int main()
19
{
20
constexpr int foo = bar();
21
}