summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/init/array3.C
blob: 700b263891fe5dfa8d5c94252c297d0f0653093c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// PR c++/6331
// Bug: we were generating a badly cv-qualified ARRAY_TYPE in the
// synthesized copy constructor for A, which then became the canonical
// version, confusing later uses.

struct A {
  virtual ~A();
  const float* f();
  float fa[3];
};

struct B {
  B(const A& ai) : a (ai) {}
  A a;
};

void g (const float pos[3]);

extern A& a;
void h()
{
  g (a.f());
}