repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
PR tree-optimization/86415 - strlen() not folded for substrings within constant arrays
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
cpp1z
/
aligned-new3.C
blob
2bfb6b8d51933480fcedefaf4fce83ac9c3e6947
1
// { dg-options -std=c++17 }
2
// { dg-do run }
3
4
#include <new>
5
6
struct alignas(64) A {
7
int i;
8
};
9
10
void* operator new (std::size_t n, std::align_val_t)
11
{
12
return operator new (n);
13
}
14
15
bool deleted = false;
16
void operator delete (void *p, std::size_t, std::align_val_t)
17
{
18
deleted = true;
19
operator delete (p);
20
}
21
22
int main()
23
{
24
A *p = new A;
25
delete p;
26
if (!deleted)
27
__builtin_abort();
28
}