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
tree-optimization/116481 - avoid building function_type[]
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
cpp1y
/
constexpr-mutable1.C
blob
6c47988c01a02ad5aa11f8356899641e18b9d6c1
1
// PR c++/92505
2
// { dg-do compile { target c++14 } }
3
4
struct S { mutable int m; };
5
6
static_assert(S{42}.m == 42, "");
7
8
constexpr int f() {
9
S s = {40};
10
s.m++;
11
const auto& cs = s;
12
++cs.m;
13
return cs.m;
14
}
15
16
static_assert(f() == 42, "");