111
|
1 // { dg-do compile }
|
|
2 // { dg-additional-options "-std=c++14" }
|
131
|
3 // { dg-require-effective-target alloca }
|
111
|
4
|
|
5 namespace std {
|
|
6 typedef __SIZE_TYPE__ size_t;
|
|
7 struct nothrow_t;
|
|
8 }
|
|
9 namespace vespamalloc {
|
|
10 void fn1(void *);
|
|
11 template <typename> class A {
|
|
12 public:
|
|
13 static unsigned long fillStack(unsigned long);
|
|
14 };
|
|
15 template <typename StackRep>
|
|
16 unsigned long A<StackRep>::fillStack(unsigned long p1) {
|
|
17 void *retAddr[p1];
|
|
18 fn1(retAddr);
|
131
|
19 return 0;
|
111
|
20 }
|
|
21 class B {
|
|
22 protected:
|
|
23 B(void *);
|
|
24 };
|
|
25 template <int StackTraceLen> class D : B {
|
|
26 public:
|
|
27 D() : B(0) {}
|
|
28 void alloc(int) { A<int>::fillStack(StackTraceLen); }
|
|
29 };
|
|
30 template <typename, typename> class C {
|
|
31 public:
|
|
32 void *malloc(unsigned long);
|
|
33 };
|
|
34 template <typename MemBlockPtrT, typename ThreadListT>
|
|
35 void *C<MemBlockPtrT, ThreadListT>::malloc(unsigned long) {
|
|
36 MemBlockPtrT mem;
|
|
37 mem.alloc(0);
|
131
|
38 return 0;
|
111
|
39 }
|
|
40 C<D<16>, int> *_GmemP;
|
|
41 }
|
|
42 void *operator new(std::size_t, std::nothrow_t &) noexcept {
|
|
43 return vespamalloc::_GmemP->malloc(0);
|
|
44 }
|
|
45 void *operator new[](std::size_t, std::nothrow_t &) noexcept {
|
|
46 return vespamalloc::_GmemP->malloc(0);
|
|
47 }
|