Fortran: Fix PR 47485.
[gcc.git] / gcc / testsuite / g++.dg / warn / Wclass-memaccess-5.C
blobd0fffead56d3afaf5f9c2ffe2ed9917713eb23a6
1 /* PR c++/92001 - missing -Wclass-memaccess with array as first argument
2    to memset
3    { dg-do compile }
4    { dg-options "-Wall" } */
6 extern "C" void* memset (void*, int, __SIZE_TYPE__);
8 struct S { S (); };
10 void test_array_access (S *p, S (*pa)[2], S (&r)[3])
12   S a[1];
13   memset (a, 0, sizeof a);        // { dg-warning "-Wclass-memaccess" }
15   memset (*pa, 0, sizeof *pa);    // { dg-warning "-Wclass-memaccess" }
17   memset (r, 0, sizeof r);        // { dg-warning "-Wclass-memaccess" }