| 1 |
// PR c++/92505 |
| 2 |
// { dg-do compile { target c++11 } } |
| 3 |
|
| 4 |
struct A { mutable int m; }; |
| 5 |
|
| 6 |
constexpr int f(A a) { return a.m; } |
| 7 |
// { dg-error "mutable" "" { target c++11_only } .-1 } |
| 8 |
|
| 9 |
static_assert(f({42}) == 42, ""); |
| 10 |
// { dg-error "non-constant" "" { target c++11_only } .-1 } |