OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [init/] [placement5.C] - Blame information for rev 718

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// 5.3.4/19: If the lookup finds the two-parameter form of a usual
2
// deallocation function (3.7.4.2) and that function, considered as a
3
// placement deallocation function, would have been selected as a match for
4
// the allocation function, the program is ill-formed.
5
 
6
// But we should only complain about using op delete (void *, size_t) for
7
// placement delete if it would also be selected for normal delete, not if
8
// there's also an op delete (void *).
9
 
10
typedef __SIZE_TYPE__ size_t;
11
 
12
struct A
13
{
14
  A();
15
  void* operator new (size_t, size_t);
16
  void operator delete (void *, size_t); // { dg-error "non-placement" }
17
};
18
 
19
struct B
20
{
21
  B();
22
  void * operator new (size_t);
23
  void * operator new (size_t, size_t);
24
  void operator delete (void *);
25
  void operator delete (void *, size_t);
26
};
27
 
28
int main()
29
{
30
  A* ap = new (24) A;           // { dg-error "placement delete" }
31
  B* bp = new (24) B;
32
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.