aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/vect/pr21734_1.cc
blob: c65d9fcaa81398d5823df846390c4d270781d5d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* { dg-do compile } */

struct A
{
  int a[4];
  int& operator[](int i) { return a[i]; }
};

struct B : public A
{
  int& operator[](int i) { return A::operator[](i); }
};

void foo(B &b)
{
  for (int i=0; i<4; ++i)
    b[i] = 0;
}

/* { dg-final { cleanup-tree-dump "vect" } } */