(root)/
gcc-13.2.0/
gcc/
testsuite/
g++.dg/
cpp1y/
constexpr-mutable1.C
// PR c++/92505
// { dg-do compile { target c++14 } }

struct S { mutable int m; };

static_assert(S{42}.m == 42, "");

constexpr int f() {
  S s = {40};
  s.m++;
  const auto& cs = s;
  ++cs.m;
  return cs.m;
}

static_assert(f() == 42, "");