summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/other/array4.C
blob: 97ccc986d61ef05f4f48aef47155fcd1a168deb1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// PR C++/28906: new on an array causes incomplete arrays to
// become complete with the wrong size.
// The sizeof machineMain should be 5 and not 100.
// { dg-do run }


extern char machineMain[];
void sort (long len)
{
  new char[100];
}
char machineMain[] = "main";
int main(void)
{
  if (sizeof(machineMain)!=sizeof("main"))
    __builtin_abort();
}