#endif
}
+#if __cplusplus < 201103L
+typedef unsigned short char16_t;
+#endif
+
/* Ordinary bzcopy and bzero aren't recognized as special. */
#define bcopy __builtin_bcopy
#define bzero __builtin_bzero
void test (HasDefault *p, const HasDefault &x,
void *q, const unsigned char *s, const std::byte *b,
+ const signed char *ss, const char16_t *ws,
const int ia[])
{
const int i = *ia;
T (memcpy, (p, ia, sizeof *p)); // { dg-warning ".void\\* memcpy(\[^\n\r\]*). copying an object of non-trivial type .struct HasDefault. from an array of .const int." }
extern long *ip;
T (memcpy, (p, ip, sizeof *p)); // { dg-warning ".void\\* memcpy(\[^\n\r\]*). copying an object of non-trivial type .struct HasDefault. from an array of .long." }
+ T (memcpy, (p, ss, sizeof *p)); // { dg-warning ".void\\* memcpy(\[^\n\r\]*). copying an object of non-trivial type .struct HasDefault. from an array of .const signed char." }
+ T (memcpy, (p, ws, sizeof *p)); // { dg-warning ".void\\* memcpy(\[^\n\r\]*). copying an object of non-trivial type .struct HasDefault. from an array of .const \(char16_t\|unsigned short\)." }
T (memmove, (p, ia, sizeof *p)); // { dg-warning ".void\\* memmove(\[^\n\r\]*). copying an object of non-trivial type .struct HasDefault. from an array of .const int." }
void test (HasTemplateDefault *p, const HasTemplateDefault &x,
const void *q, const unsigned char *s, const std::byte *b,
+ const signed char *ss, const char16_t *ws,
const int ia[])
{
const int i = *ia;
T (bcopy, (q, p, sizeof *p));
T (bcopy, (s, p, sizeof *p));
T (bcopy, (b, p, sizeof *p));
+ T (bcopy, (ss, p, sizeof *p)); // { dg-warning "bcopy" }
+ T (bcopy, (ws, p, sizeof *p)); // { dg-warning "bcopy" }
T (bcopy, (ia, p, sizeof *p)); // { dg-warning "bcopy" }
T (memcpy, (p, &x, sizeof *p));
T (memcpy, (p, q, sizeof *p));
T (memcpy, (p, s, sizeof *p));
T (memcpy, (p, b, sizeof *p));
+ T (memcpy, (p, ss, sizeof *p)); // { dg-warning "memcpy" }
+ T (memcpy, (p, ws, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, ia, sizeof *p)); // { dg-warning "memcpy" }
T (memmove, (p, &x, sizeof *p));
T (memmove, (p, q, sizeof *p));
T (memmove, (p, s, sizeof *p));
T (memmove, (p, b, sizeof *p));
+ T (memmove, (p, ss, sizeof *p)); // { dg-warning "memmove" }
+ T (memmove, (p, ws, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, ia, sizeof *p)); // { dg-warning "memmove" }
T (mempcpy, (p, &x, sizeof *p));
T (mempcpy, (p, q, sizeof *p));
T (mempcpy, (p, s, sizeof *p));
T (mempcpy, (p, b, sizeof *p));
+ T (mempcpy, (p, ss, sizeof *p)); // { dg-warning "mempcpy" }
+ T (mempcpy, (p, ws, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, ia, sizeof *p)); // { dg-warning "mempcpy" }
// Reallocating is the same as calling memcpy.
void test (HasCopy *p, const HasCopy &x,
const void *q, const unsigned char *s, const std::byte *b,
+ const signed char *ss, const char16_t *ws,
const int ia[])
{
const int i = *ia;
T (bcopy, (q, p, sizeof *p)); // { dg-warning "bcopy" }
T (bcopy, (s, p, sizeof *p)); // { dg-warning "bcopy" }
T (bcopy, (b, p, sizeof *p)); // { dg-warning "bcopy" }
+ T (bcopy, (ss, p, sizeof *p)); // { dg-warning "bcopy" }
+ T (bcopy, (ws, p, sizeof *p)); // { dg-warning "bcopy" }
T (bcopy, (ia, p, sizeof *p)); // { dg-warning "bcopy" }
T (memcpy, (p, &x, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, q, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, s, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, b, sizeof *p)); // { dg-warning "memcpy" }
+ T (memcpy, (p, ss, sizeof *p)); // { dg-warning "memcpy" }
+ T (memcpy, (p, ws, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, ia, sizeof *p)); // { dg-warning "memcpy" }
T (memmove, (p, &x, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, q, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, s, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, b, sizeof *p)); // { dg-warning "memmove" }
+ T (memmove, (p, ss, sizeof *p)); // { dg-warning "memmove" }
+ T (memmove, (p, ws, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, ia, sizeof *p)); // { dg-warning "memmove" }
T (mempcpy, (p, &x, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, q, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, s, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, b, sizeof *p)); // { dg-warning "mempcpy" }
+ T (mempcpy, (p, ss, sizeof *p)); // { dg-warning "mempcpy" }
+ T (mempcpy, (p, ws, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, ia, sizeof *p)); // { dg-warning "mempcpy" }
// Reallocating is the same as calling memcpy.
void test (HasPrivateCopy *p, const HasPrivateCopy &x,
const void *q, const unsigned char *s, const std::byte *b,
+ const signed char *ss, const char16_t *ws,
const int ia[])
{
const int i = *ia;
T (memcpy, (p, q, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, s, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, b, sizeof *p)); // { dg-warning "memcpy" }
+ T (memcpy, (p, ss, sizeof *p)); // { dg-warning "memcpy" }
+ T (memcpy, (p, ws, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, ia, sizeof *p)); // { dg-warning "memcpy" }
T (memmove, (p, &x, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, q, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, s, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, b, sizeof *p)); // { dg-warning "memmove" }
+ T (memmove, (p, ss, sizeof *p)); // { dg-warning "memmove" }
+ T (memmove, (p, ws, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, ia, sizeof *p)); // { dg-warning "memmove" }
T (mempcpy, (p, &x, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, q, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, s, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, b, sizeof *p)); // { dg-warning "mempcpy" }
+ T (mempcpy, (p, ss, sizeof *p)); // { dg-warning "mempcpy" }
+ T (mempcpy, (p, ws, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, ia, sizeof *p)); // { dg-warning "mempcpy" }
// Reallocating is the same as calling memcpy.
void test (HasDtor *p, const HasDtor &x,
const void *q, const unsigned char *s, const std::byte *b,
+ const signed char *ss, const char16_t *ws,
const int ia[])
{
const int i = *ia;
T (memcpy, (p, q, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, s, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, b, sizeof *p)); // { dg-warning "memcpy" }
+ T (memcpy, (p, ss, sizeof *p)); // { dg-warning "memcpy" }
+ T (memcpy, (p, ws, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, ia, sizeof *p)); // { dg-warning "memcpy" }
T (memmove, (p, &x, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, q, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, s, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, b, sizeof *p)); // { dg-warning "memmove" }
+ T (memmove, (p, ss, sizeof *p)); // { dg-warning "memmove" }
+ T (memmove, (p, ws, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, ia, sizeof *p)); // { dg-warning "memmove" }
T (mempcpy, (p, &x, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, q, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, s, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, b, sizeof *p)); // { dg-warning "mempcpy" }
+ T (mempcpy, (p, ss, sizeof *p)); // { dg-warning "mempcpy" }
+ T (mempcpy, (p, ws, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, ia, sizeof *p)); // { dg-warning "mempcpy" }
// Reallocating is the same as calling memcpy.
#if !defined TEST || TEST == TEST_HAS_DELETED_DTOR
-// HasDeletedDtor is trivial so clearing and cpying it is okay.
+// HasDeletedDtor is trivial so clearing and copying it is okay.
// Relocation would bypass the deleted dtor and so it's diagnosed.
struct HasDeletedDtor
void test (HasDeletedDtor *p, const HasDeletedDtor &x,
const void *q, const unsigned char *s, const std::byte *b,
+ const signed char *ss, const char16_t *ws,
const int ia[])
{
const int i = *ia;
T (memcpy, (p, q, sizeof *p));
T (memcpy, (p, s, sizeof *p));
T (memcpy, (p, b, sizeof *p));
+ T (memcpy, (p, ss, sizeof *p));
+ T (memcpy, (p, ws, sizeof *p));
T (memcpy, (p, ia, sizeof *p));
T (memmove, (p, &x, sizeof *p));
T (memmove, (p, q, sizeof *p));
T (memmove, (p, s, sizeof *p));
T (memmove, (p, b, sizeof *p));
+ T (memmove, (p, ss, sizeof *p));
+ T (memmove, (p, ws, sizeof *p));
T (memmove, (p, ia, sizeof *p));
T (mempcpy, (p, &x, sizeof *p));
T (mempcpy, (p, q, sizeof *p));
T (mempcpy, (p, s, sizeof *p));
T (mempcpy, (p, b, sizeof *p));
+ T (mempcpy, (p, ss, sizeof *p));
+ T (mempcpy, (p, ws, sizeof *p));
T (mempcpy, (p, ia, sizeof *p));
// Reallocating is diagnosed.
void test (HasPrivateDtor *p, const HasPrivateDtor &x,
const void *q, const unsigned char *s, const std::byte *b,
+ const signed char *ss, const char16_t *ws,
const int ia[])
{
const int i = *ia;
T (memcpy, (p, q, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, s, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, b, sizeof *p)); // { dg-warning "memcpy" }
+ T (memcpy, (p, ss, sizeof *p)); // { dg-warning "memcpy" }
+ T (memcpy, (p, ws, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, ia, sizeof *p)); // { dg-warning "memcpy" }
T (memmove, (p, &x, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, q, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, s, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, b, sizeof *p)); // { dg-warning "memmove" }
+ T (memmove, (p, ss, sizeof *p)); // { dg-warning "memmove" }
+ T (memmove, (p, ws, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, ia, sizeof *p)); // { dg-warning "memmove" }
T (mempcpy, (p, &x, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, q, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, s, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, b, sizeof *p)); // { dg-warning "mempcpy" }
+ T (mempcpy, (p, ss, sizeof *p)); // { dg-warning "mempcpy" }
+ T (mempcpy, (p, ws, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, ia, sizeof *p)); // { dg-warning "mempcpy" }
// Reallocating is diagnosed.
void test (HasCopyAssign *p, const HasCopyAssign &x,
const void *q, const unsigned char *s, const std::byte *b,
+ const signed char *ss, const char16_t *ws,
const int ia[])
{
const int i = *ia;
T (memcpy, (p, q, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, s, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, b, sizeof *p)); // { dg-warning "memcpy" }
+ T (memcpy, (p, ss, sizeof *p)); // { dg-warning "memcpy" }
+ T (memcpy, (p, ws, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, ia, sizeof *p)); // { dg-warning "memcpy" }
T (memmove, (p, &x, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, q, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, s, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, b, sizeof *p)); // { dg-warning "memmove" }
+ T (memmove, (p, ss, sizeof *p)); // { dg-warning "memmove" }
+ T (memmove, (p, ws, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, ia, sizeof *p)); // { dg-warning "memmove" }
T (mempcpy, (p, &x, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, q, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, s, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, b, sizeof *p)); // { dg-warning "mempcpy" }
+ T (mempcpy, (p, ss, sizeof *p)); // { dg-warning "mempcpy" }
+ T (mempcpy, (p, ws, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, ia, sizeof *p)); // { dg-warning "mempcpy" }
// Reallocating is the same as calling memcpy.
void test (HasMoveAssign *p, const HasMoveAssign &x,
const void *q, const unsigned char *s, const std::byte *b,
+ const signed char *ss, const char16_t *ws,
const int ia[])
{
const int i = *ia;
T (memcpy, (p, q, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, s, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, b, sizeof *p)); // { dg-warning "memcpy" }
+ T (memcpy, (p, ss, sizeof *p)); // { dg-warning "memcpy" }
+ T (memcpy, (p, ws, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, ia, sizeof *p)); // { dg-warning "memcpy" }
T (memmove, (p, &x, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, q, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, s, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, b, sizeof *p)); // { dg-warning "memmove" }
+ T (memmove, (p, ss, sizeof *p)); // { dg-warning "memmove" }
+ T (memmove, (p, ws, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, ia, sizeof *p)); // { dg-warning "memmove" }
T (mempcpy, (p, &x, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, q, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, s, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, b, sizeof *p)); // { dg-warning "mempcpy" }
+ T (mempcpy, (p, ss, sizeof *p)); // { dg-warning "mempcpy" }
+ T (mempcpy, (p, ws, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, ia, sizeof *p)); // { dg-warning "mempcpy" }
// Reallocating is the same as calling memcpy.
void test (TrivialCopyHasMoveAssign *p, const TrivialCopyHasMoveAssign &x,
const void *q, const unsigned char *s, const std::byte *b,
+ const signed char *ss, const char16_t *ws,
const int ia[])
{
const int i = *ia;
T (memcpy, (p, q, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, s, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, b, sizeof *p)); // { dg-warning "memcpy" }
+ T (memcpy, (p, ss, sizeof *p)); // { dg-warning "memcpy" }
+ T (memcpy, (p, ws, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, ia, sizeof *p)); // { dg-warning "memcpy" }
T (memmove, (p, &x, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, q, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, s, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, b, sizeof *p)); // { dg-warning "memmove" }
+ T (memmove, (p, ss, sizeof *p)); // { dg-warning "memmove" }
+ T (memmove, (p, ws, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, ia, sizeof *p)); // { dg-warning "memmove" }
T (mempcpy, (p, &x, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, q, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, s, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, b, sizeof *p)); // { dg-warning "mempcpy" }
+ T (mempcpy, (p, ss, sizeof *p)); // { dg-warning "mempcpy" }
+ T (mempcpy, (p, ws, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, ia, sizeof *p)); // { dg-warning "mempcpy" }
// Reallocating is the same as calling memcpy.
void test (TrivialMoveNontrivialCopyAssign *p,
const TrivialMoveNontrivialCopyAssign &x,
const void *q, const unsigned char *s, const std::byte *b,
+ const signed char *ss, const char16_t *ws,
const int ia[])
{
const int i = *ia;
T (memcpy, (p, q, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, s, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, b, sizeof *p)); // { dg-warning "memcpy" }
+ T (memcpy, (p, ss, sizeof *p)); // { dg-warning "memcpy" }
+ T (memcpy, (p, ws, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, ia, sizeof *p)); // { dg-warning "memcpy" }
T (memmove, (p, &x, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, q, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, s, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, b, sizeof *p)); // { dg-warning "memmove" }
+ T (memmove, (p, ss, sizeof *p)); // { dg-warning "memmove" }
+ T (memmove, (p, ws, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, ia, sizeof *p)); // { dg-warning "memmove" }
T (mempcpy, (p, &x, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, q, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, s, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, b, sizeof *p)); // { dg-warning "mempcpy" }
+ T (mempcpy, (p, ss, sizeof *p)); // { dg-warning "mempcpy" }
+ T (mempcpy, (p, ws, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, ia, sizeof *p)); // { dg-warning "mempcpy" }
// Reallocating is the same as calling memcpy.
void test (TrivialAssignRefOverload *p, const TrivialAssignRefOverload &x,
const void *q, const unsigned char *s, const std::byte *b,
+ const signed char *ss, const char16_t *ws,
const int ia[])
{
const int i = *ia;
T (memcpy, (p, q, sizeof *p));
T (memcpy, (p, s, sizeof *p));
T (memcpy, (p, b, sizeof *p));
+ T (memcpy, (p, ss, sizeof *p));
+ T (memcpy, (p, ws, sizeof *p));
T (memcpy, (p, ia, sizeof *p));
T (memmove, (p, &x, sizeof *p));
T (memmove, (p, q, sizeof *p));
T (memmove, (p, s, sizeof *p));
T (memmove, (p, b, sizeof *p));
+ T (memmove, (p, ss, sizeof *p));
+ T (memmove, (p, ws, sizeof *p));
T (memmove, (p, ia, sizeof *p));
T (mempcpy, (p, &x, sizeof *p));
T (mempcpy, (p, q, sizeof *p));
T (mempcpy, (p, s, sizeof *p));
T (mempcpy, (p, b, sizeof *p));
+ T (mempcpy, (p, ss, sizeof *p));
+ T (mempcpy, (p, ws, sizeof *p));
T (mempcpy, (p, ia, sizeof *p));
T (q = realloc, (p, 1));
void test (TrivialAssignCstRefOverload *p,
const TrivialAssignCstRefOverload &x,
const void *q, const unsigned char *s, std::byte *b,
+ const signed char *ss, const char16_t *ws,
const int ia[])
{
const int i = *ia;
T (memcpy, (p, q, sizeof *p));
T (memcpy, (p, s, sizeof *p));
T (memcpy, (p, b, sizeof *p));
+ T (memcpy, (p, ss, sizeof *p));
+ T (memcpy, (p, ws, sizeof *p));
T (memcpy, (p, ia, sizeof *p));
T (memmove, (p, &x, sizeof *p));
T (memmove, (p, q, sizeof *p));
T (memmove, (p, s, sizeof *p));
T (memmove, (p, b, sizeof *p));
+ T (memmove, (p, ss, sizeof *p));
+ T (memmove, (p, ws, sizeof *p));
T (memmove, (p, ia, sizeof *p));
T (mempcpy, (p, &x, sizeof *p));
T (mempcpy, (p, q, sizeof *p));
T (mempcpy, (p, s, sizeof *p));
T (mempcpy, (p, b, sizeof *p));
+ T (mempcpy, (p, ss, sizeof *p));
+ T (mempcpy, (p, ws, sizeof *p));
T (mempcpy, (p, ia, sizeof *p));
T (q = realloc, (p, 1));
void test (TrivialRefHasVolRefAssign *p,
const TrivialRefHasVolRefAssign &x,
const void *q, const unsigned char *s, const std::byte *b,
+ const signed char *ss, const char16_t *ws,
const int ia[])
{
const int i = *ia;
T (memcpy, (p, q, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, s, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, b, sizeof *p)); // { dg-warning "memcpy" }
+ T (memcpy, (p, ss, sizeof *p)); // { dg-warning "memcpy" }
+ T (memcpy, (p, ws, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, ia, sizeof *p)); // { dg-warning "memcpy" }
T (memmove, (p, &x, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, q, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, s, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, b, sizeof *p)); // { dg-warning "memmove" }
+ T (memmove, (p, ss, sizeof *p)); // { dg-warning "memmove" }
+ T (memmove, (p, ws, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, ia, sizeof *p)); // { dg-warning "memmove" }
T (mempcpy, (p, &x, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, q, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, s, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, b, sizeof *p)); // { dg-warning "mempcpy" }
+ T (mempcpy, (p, ss, sizeof *p)); // { dg-warning "mempcpy" }
+ T (mempcpy, (p, ws, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, ia, sizeof *p)); // { dg-warning "mempcpy" }
// Reallocating is the same as calling memcpy.
void test (HasVolRefAssign *p, const HasVolRefAssign &x,
const void *q, const unsigned char *s, const std::byte *b,
+ const signed char *ss, const char16_t *ws,
const int ia[])
{
const int i = *ia;
T (memcpy, (p, q, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, s, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, b, sizeof *p)); // { dg-warning "memcpy" }
+ T (memcpy, (p, ss, sizeof *p)); // { dg-warning "memcpy" }
+ T (memcpy, (p, ws, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, ia, sizeof *p)); // { dg-warning "memcpy" }
T (memmove, (p, &x, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, q, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, s, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, b, sizeof *p)); // { dg-warning "memmove" }
+ T (memmove, (p, ss, sizeof *p)); // { dg-warning "memmove" }
+ T (memmove, (p, ws, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, ia, sizeof *p)); // { dg-warning "memmove" }
T (mempcpy, (p, &x, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, q, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, s, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, b, sizeof *p)); // { dg-warning "mempcpy" }
+ T (mempcpy, (p, ss, sizeof *p)); // { dg-warning "mempcpy" }
+ T (mempcpy, (p, ws, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, ia, sizeof *p)); // { dg-warning "mempcpy" }
// Reallocating is the same as calling memcpy.
void test (HasVirtuals *p, const HasVirtuals &x,
const void *q, const unsigned char *s, const std::byte *b,
+ const signed char *ss, const char16_t *ws,
const int ia[])
{
const int i = *ia;
T (memcpy, (p, q, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, s, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, b, sizeof *p)); // { dg-warning "memcpy" }
+ T (memcpy, (p, ss, sizeof *p)); // { dg-warning "memcpy" }
+ T (memcpy, (p, ws, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, ia, sizeof *p)); // { dg-warning "memcpy" }
T (memmove, (p, &x, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, q, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, s, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, b, sizeof *p)); // { dg-warning "memmove" }
+ T (memmove, (p, ss, sizeof *p)); // { dg-warning "memmove" }
+ T (memmove, (p, ws, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, ia, sizeof *p)); // { dg-warning "memmove" }
T (mempcpy, (p, &x, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, q, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, s, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, b, sizeof *p)); // { dg-warning "mempcpy" }
+ T (mempcpy, (p, ss, sizeof *p)); // { dg-warning "mempcpy" }
+ T (mempcpy, (p, ws, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, ia, sizeof *p)); // { dg-warning "mempcpy" }
// Reallocating is the same as calling memcpy.
void test (HasConstData *p, const HasConstData &x,
const void *q, const unsigned char *s, const std::byte *b,
+ const signed char *ss, const char16_t *ws,
const int ia[])
{
const int i = *ia;
T (memcpy, (p, q, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, s, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, b, sizeof *p)); // { dg-warning "memcpy" }
+ T (memcpy, (p, ss, sizeof *p)); // { dg-warning "memcpy" }
+ T (memcpy, (p, ws, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, ia, sizeof *p)); // { dg-warning "memcpy" }
T (memmove, (p, &x, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, q, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, s, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, b, sizeof *p)); // { dg-warning "memmove" }
+ T (memmove, (p, ss, sizeof *p)); // { dg-warning "memmove" }
+ T (memmove, (p, ws, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, ia, sizeof *p)); // { dg-warning "memmove" }
T (mempcpy, (p, &x, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, q, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, s, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, b, sizeof *p)); // { dg-warning "mempcpy" }
+ T (mempcpy, (p, ss, sizeof *p)); // { dg-warning "mempcpy" }
+ T (mempcpy, (p, ws, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, ia, sizeof *p)); // { dg-warning "mempcpy" }
// Reallocating is not diagnosed except in C++ 98 due to a bug.
void test (HasReference *p, const HasReference &x,
const void *q, const unsigned char *s, const std::byte *b,
+ const signed char *ss, const char16_t *ws,
const int ia[])
{
const int i = *ia;
T (memcpy, (p, s, n)); // { dg-warning "memcpy" }
T (memcpy, (p, b, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, b, n)); // { dg-warning "memcpy" }
+ T (memcpy, (p, ss, sizeof *p)); // { dg-warning "memcpy" }
+ T (memcpy, (p, ss, n)); // { dg-warning "memcpy" }
+ T (memcpy, (p, ws, sizeof *p)); // { dg-warning "memcpy" }
+ T (memcpy, (p, ws, n)); // { dg-warning "memcpy" }
T (memcpy, (p, ia, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, ia, n)); // { dg-warning "memcpy" }
T (memmove, (p, q, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, s, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, b, sizeof *p)); // { dg-warning "memmove" }
+ T (memmove, (p, ss, sizeof *p)); // { dg-warning "memmove" }
+ T (memmove, (p, ws, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, ia, sizeof *p)); // { dg-warning "memmove" }
T (mempcpy, (p, &x, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, q, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, s, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, b, sizeof *p)); // { dg-warning "mempcpy" }
+ T (mempcpy, (p, ss, sizeof *p)); // { dg-warning "mempcpy" }
+ T (mempcpy, (p, ws, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, ia, sizeof *p)); // { dg-warning "mempcpy" }
// Reallocating is not diagnosed because a type with a reference
void test (HasMemDataPtr *p, const HasMemDataPtr &x,
const void *q, const unsigned char *s, const std::byte *b,
+ const signed char *ss, const char16_t *ws,
const int ia[])
{
const int i = *ia;
T (memcpy, (p, s, n));
T (memcpy, (p, b, sizeof *p));
T (memcpy, (p, b, n));
+ T (memcpy, (p, ss, sizeof *p));
+ T (memcpy, (p, ss, n));
+ T (memcpy, (p, ws, sizeof *p));
+ T (memcpy, (p, ws, n));
T (memcpy, (p, ia, sizeof *p));
T (memcpy, (p, ia, n));
T (memmove, (p, q, sizeof *p));
T (memmove, (p, s, sizeof *p));
T (memmove, (p, b, sizeof *p));
+ T (memmove, (p, ss, sizeof *p));
+ T (memmove, (p, ws, sizeof *p));
T (memmove, (p, ia, sizeof *p));
T (mempcpy, (p, &x, sizeof *p));
T (mempcpy, (p, q, sizeof *p));
T (mempcpy, (p, s, sizeof *p));
T (mempcpy, (p, b, sizeof *p));
+ T (mempcpy, (p, ss, sizeof *p));
+ T (mempcpy, (p, ws, sizeof *p));
T (mempcpy, (p, ia, sizeof *p));
// Reallocating is the same as calling memcpy.
void test (HasSomePrivateData *p, const HasSomePrivateData &x,
const void *q, const unsigned char *s, const std::byte *b,
+ const signed char *ss, const char16_t *ws,
const int ia[])
{
const int i = *ia;
T (memcpy, (p, q, sizeof *p));
T (memcpy, (p, s, sizeof *p));
T (memcpy, (p, b, sizeof *p));
+ T (memcpy, (p, ss, sizeof *p)); // { dg-warning "memcpy" }
+ T (memcpy, (p, ss, n)); // { dg-warning "memcpy" }
+ T (memcpy, (p, ws, sizeof *p)); // { dg-warning "memcpy" }
+ T (memcpy, (p, ws, n)); // { dg-warning "memcpy" }
T (memcpy, (p, ia, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, ia, n)); // { dg-warning "memcpy" }
T (memmove, (p, q, sizeof *p));
T (memmove, (p, s, sizeof *p));
T (memmove, (p, b, sizeof *p));
+ T (memmove, (p, ss, sizeof *p)); // { dg-warning "memmove" }
+ T (memmove, (p, ss, n)); // { dg-warning "memmove" }
+ T (memmove, (p, ws, sizeof *p)); // { dg-warning "memmove" }
+ T (memmove, (p, ws, n)); // { dg-warning "memmove" }
T (memmove, (p, ia, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, ia, n)); // { dg-warning "memmove" }
T (mempcpy, (p, s, n));
T (mempcpy, (p, b, sizeof *p));
T (mempcpy, (p, b, n));
+ T (mempcpy, (p, ss, sizeof *p)); // { dg-warning "mempcpy" }
+ T (mempcpy, (p, ss, n)); // { dg-warning "mempcpy" }
+ T (mempcpy, (p, ws, sizeof *p)); // { dg-warning "mempcpy" }
+ T (mempcpy, (p, ws, n)); // { dg-warning "mempcpy" }
T (mempcpy, (p, ia, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, ia, n)); // { dg-warning "mempcpy" }
void test (HasSomeProtectedData *p, const HasSomeProtectedData &x,
const void *q, const unsigned char *s, const std::byte *b,
+ const signed char *ss, const char16_t *ws,
const int ia[])
{
const int i = *ia;
T (memcpy, (p, q, sizeof *p));
T (memcpy, (p, s, sizeof *p));
T (memcpy, (p, b, sizeof *p));
+ T (memcpy, (p, ss, sizeof *p)); // { dg-warning "memcpy" }
+ T (memcpy, (p, ss, n)); // { dg-warning "memcpy" }
+ T (memcpy, (p, ws, sizeof *p)); // { dg-warning "memcpy" }
+ T (memcpy, (p, ws, n)); // { dg-warning "memcpy" }
T (memcpy, (p, ia, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, ia, n)); // { dg-warning "memcpy" }
T (memmove, (p, q, sizeof *p));
T (memmove, (p, s, sizeof *p));
T (memmove, (p, b, sizeof *p));
+ T (memmove, (p, ss, sizeof *p)); // { dg-warning "memmove" }
+ T (memmove, (p, ss, n)); // { dg-warning "memmove" }
+ T (memmove, (p, ws, sizeof *p)); // { dg-warning "memmove" }
+ T (memmove, (p, ws, n)); // { dg-warning "memmove" }
T (memmove, (p, ia, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, ia, n)); // { dg-warning "memmove" }
T (mempcpy, (p, s, n));
T (mempcpy, (p, b, sizeof *p));
T (mempcpy, (p, b, n));
+ T (mempcpy, (p, ss, sizeof *p)); // { dg-warning "mempcpy" }
+ T (mempcpy, (p, ss, n)); // { dg-warning "mempcpy" }
+ T (mempcpy, (p, ws, sizeof *p)); // { dg-warning "mempcpy" }
+ T (mempcpy, (p, ws, n)); // { dg-warning "mempcpy" }
T (mempcpy, (p, ia, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, ia, n)); // { dg-warning "mempcpy" }
void test (HasAllPrivateData *p, const HasAllPrivateData &x,
const void *q, const unsigned char *s, const std::byte *b,
+ const signed char *ss, const char16_t *ws,
const int ia[])
{
const int i = *ia;
T (memcpy, (p, q, sizeof *p));
T (memcpy, (p, s, sizeof *p));
T (memcpy, (p, b, sizeof *p));
+ T (memcpy, (p, ss, sizeof *p)); // { dg-warning "memcpy" }
+ T (memcpy, (p, ss, n)); // { dg-warning "memcpy" }
+ T (memcpy, (p, ws, sizeof *p)); // { dg-warning "memcpy" }
+ T (memcpy, (p, ws, n)); // { dg-warning "memcpy" }
T (memcpy, (p, ia, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, ia, n)); // { dg-warning "memcpy" }
T (memmove, (p, q, sizeof *p));
T (memmove, (p, s, sizeof *p));
T (memmove, (p, b, sizeof *p));
+ T (memmove, (p, ss, sizeof *p)); // { dg-warning "memmove" }
+ T (memmove, (p, ss, n)); // { dg-warning "memmove" }
+ T (memmove, (p, ws, sizeof *p)); // { dg-warning "memmove" }
+ T (memmove, (p, ws, n)); // { dg-warning "memmove" }
T (memmove, (p, ia, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, ia, n)); // { dg-warning "memmove" }
T (mempcpy, (p, s, n));
T (mempcpy, (p, b, sizeof *p));
T (mempcpy, (p, b, n));
+ T (mempcpy, (p, ss, sizeof *p)); // { dg-warning "mempcpy" }
+ T (mempcpy, (p, ss, n)); // { dg-warning "mempcpy" }
+ T (mempcpy, (p, ws, sizeof *p)); // { dg-warning "mempcpy" }
+ T (mempcpy, (p, ws, n)); // { dg-warning "mempcpy" }
T (mempcpy, (p, ia, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, ia, n)); // { dg-warning "mempcpy" }
void test (HasAllProtectedData *p, const HasAllProtectedData &x,
const void *q, const unsigned char *s, const std::byte *b,
+ const signed char *ss, const char16_t *ws,
const int ia[])
{
const int i = *ia;
T (memcpy, (p, q, sizeof *p));
T (memcpy, (p, s, sizeof *p));
T (memcpy, (p, b, sizeof *p));
+ T (memcpy, (p, ss, sizeof *p)); // { dg-warning "memcpy" }
+ T (memcpy, (p, ss, n)); // { dg-warning "memcpy" }
+ T (memcpy, (p, ws, sizeof *p)); // { dg-warning "memcpy" }
+ T (memcpy, (p, ws, n)); // { dg-warning "memcpy" }
T (memcpy, (p, ia, sizeof *p)); // { dg-warning "memcpy" }
T (memcpy, (p, ia, n)); // { dg-warning "memcpy" }
T (memmove, (p, q, sizeof *p));
T (memmove, (p, s, sizeof *p));
T (memmove, (p, b, sizeof *p));
+ T (memmove, (p, ss, sizeof *p)); // { dg-warning "memmove" }
+ T (memmove, (p, ss, n)); // { dg-warning "memmove" }
+ T (memmove, (p, ws, sizeof *p)); // { dg-warning "memmove" }
+ T (memmove, (p, ws, n)); // { dg-warning "memmove" }
T (memmove, (p, ia, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, ia, n)); // { dg-warning "memmove" }
T (mempcpy, (p, s, n));
T (mempcpy, (p, b, sizeof *p));
T (mempcpy, (p, b, n));
+ T (mempcpy, (p, ss, sizeof *p)); // { dg-warning "mempcpy" }
+ T (mempcpy, (p, ss, n)); // { dg-warning "mempcpy" }
+ T (mempcpy, (p, ws, sizeof *p)); // { dg-warning "mempcpy" }
+ T (mempcpy, (p, ws, n)); // { dg-warning "mempcpy" }
T (mempcpy, (p, ia, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, ia, n)); // { dg-warning "mempcpy" }
void test (HasDefaultPrivateAssign *p, const HasDefaultPrivateAssign &x,
const void *q, const unsigned char *s, const std::byte *b,
+ const signed char *ss, const char16_t *ws,
const int ia[])
{
const int i = *ia;
T (mempcpy, (p, q, 3)); // { dg-warning "mempcpy" } */
// Otherwise, copying from an object of an unrelated type is diagnosed.
+ T (memcpy, (p, ss, sizeof *p)); // { dg-warning "writing to an object of type .struct HasDefaultPrivateAssign. with (deleted|no trivial) copy-assignment." }
+ T (memcpy, (p, ws, sizeof *p)); // { dg-warning "writing to an object of type .struct HasDefaultPrivateAssign. with (deleted|no trivial) copy-assignment." }
T (memcpy, (p, ia, sizeof *p)); // { dg-warning "writing to an object of type .struct HasDefaultPrivateAssign. with (deleted|no trivial) copy-assignment." }
+ T (memmove, (p, ss, sizeof *p)); // { dg-warning "memmove" }
+ T (memmove, (p, ws, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, ia, sizeof *p)); // { dg-warning "memmove" }
+ T (mempcpy, (p, ss, sizeof *p)); // { dg-warning "mempcpy" }
+ T (mempcpy, (p, ws, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, ia, sizeof *p)); // { dg-warning "mempcpy" }
// Reallocating is the same as calling memcpy.
void test (HasDefaultDeletedAssign *p, const HasDefaultDeletedAssign &x,
const void *q, const unsigned char *s, const std::byte *b,
+ const signed char *ss, const char16_t *ws,
const int ia[])
{
const int i = *ia;
T (mempcpy, (p, q, 3)); // { dg-warning "mempcpy" } */
// Otherwise, copying from an object of an unrelated type is diagnosed.
+ T (memcpy, (p, ss, sizeof *p)); // { dg-warning "writing to an object of type .struct HasDefaultDeletedAssign. with (deleted|no trivial) copy-assignment." }
+ T (memcpy, (p, ws, sizeof *p)); // { dg-warning "writing to an object of type .struct HasDefaultDeletedAssign. with (deleted|no trivial) copy-assignment." }
T (memcpy, (p, ia, sizeof *p)); // { dg-warning "writing to an object of type .struct HasDefaultDeletedAssign. with (deleted|no trivial) copy-assignment." }
+ T (memmove, (p, ss, sizeof *p)); // { dg-warning "memmove" }
+ T (memmove, (p, ws, sizeof *p)); // { dg-warning "memmove" }
T (memmove, (p, ia, sizeof *p)); // { dg-warning "memmove" }
+ T (mempcpy, (p, ss, sizeof *p)); // { dg-warning "mempcpy" }
+ T (mempcpy, (p, ws, sizeof *p)); // { dg-warning "mempcpy" }
T (mempcpy, (p, ia, sizeof *p)); // { dg-warning "mempcpy" }
// Reallocating is the same as calling memcpy.