aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/init/mutable1.C
blob: af99ee0bf8607797fced141654856c99d1a07e9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// PR c++/54026
// { dg-final { scan-assembler-not "rodata" } }

void non_const(int *);

template <typename T>
struct Foo {
  T x;
  mutable int y;
  void func() const { non_const(&y); }
};

struct Bar {
  int x;
  mutable int y;
  void func() const { non_const(&y); }
};

const Foo<int> foo = { 1, 2 };
const Bar bar = { 3, 4 };