// PR105726 // { dg-do compile } // { dg-require-effective-target c++11 } // { dg-options "-O2 -Warray-bounds" } // { dg-skip-if "requires hosted libstdc++ for cstring" { ! hostedlib } } #include #include struct X { char pad[4]; std::array mField; }; void encode(char* aBuffer, const X& aMessage) { strncpy(aBuffer, aMessage.mField.data(), 1); // { dg-bogus "bounds" } }