Fortran: Fix PR 47485.
[gcc.git] / gcc / testsuite / g++.dg / warn / Warray-bounds-16.C
blob17b4d0d194e76733e81be3438b121885265a9ffa
1 /* PR tree-optimization/92879 - incorrect warning of __builtin_memset
2    offset is out of the bounds on zero-size allocation and initialization
3    { dg-do compile }
4    { dg-options "-O2 -Wall -fdump-tree-optimized" } */
6 inline void* operator new (__SIZE_TYPE__, void * v)
8   return v;
11 struct S
13   int* p;
14   int m;
16   S (int i)
17   {
18     m = i;
19     p = (int*) new unsigned char [sizeof (int) * m];
21     for (int i = 0; i < m; i++)
22       new (p + i) int ();
23   }
26 S a (0);
28 /* Verify the loop has been eliminated.
29    { dg-final { scan-tree-dump-not "goto" "optimized" } } */