aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.law/operators28.C
blob: c0d1ecdad2db385e4d745f203d1377cfd24fbde5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Build don't link: 
// GROUPS passed operators
#include <sys/types.h>
#include <stdio.h>

class new_test
{
  int type;
public:
  void* operator new(size_t sz, int count, int type);
};

void* new_test::operator new(size_t sz, int count, int type)
{
  void *p;

  printf("%d %d %d\n", sz, count, type);

  p = new char[sz * count];
  ((new_test *)p)->type = type;
  return p;
};

main()
{
  new_test *test;
  int count = 13;

  test = new(count, 1) new_test;
};