summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/init/copy3.C
blob: fa6a6ea18841975d068e9f8e6f91a7dddf1bf570 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// { dg-do run }
// { dg-options "-fno-elide-constructors" }

int copies;

struct S { 
  S () {}
  S (const S&) { ++copies; }
};

S s[1] = { S () };

int main () {
  if (copies != 1)
    return 1;
}