view gcc/testsuite/g++.dg/cpp1y/sized-dealloc2.C @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 04ced10e8804
children
line wrap: on
line source

// Test for a diagnostic about a usual deallocation function used as a
// placement deallocation function.  This will be a warning in C++98/11
// modes and an error in C++14 mode.

// { dg-options "-Wc++14-compat" }

#include <new>
void *operator new (std::size_t s, std::size_t)
{
  return operator new (s);
}

void operator delete (void *p, std::size_t) throw()
{
  return ::operator delete (p);
}

struct A
{
  A();
};

void f()
{
  new (42) A;		// { dg-message "" }
}