gcc/testsuite/g++.dg/tree-ssa/initlist-opt6.C
raw| 1 | // { dg-do compile { target c++11 } } |
| 2 | // { dg-additional-options -fdump-tree-gimple } |
| 3 | // { dg-final { scan-tree-dump-not {static const struct S} "gimple" } } |
| 4 | |
| 5 | // Test that mutable prevents putting this init-list array in rodata. |
| 6 | |
| 7 | #include <initializer_list> |
| 8 | |
| 9 | struct S { |
| 10 | constexpr S(int i) : i(i) {} |
| 11 | mutable int i; |
| 12 | }; |
| 13 | |
| 14 | void f(std::initializer_list<S>); |
| 15 | |
| 16 | int main() { |
| 17 | f({1,2,3}); |
| 18 | } |