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
* auto-profile.c (afdo_annotate_cfg): Use update_max_bb_count.
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
init
/
call1.C
blob
d44b6dddc953db7c145f616fd0c821f53f0fcde9
1
// Bug c++/16115
2
// { dg-options "-O2" }
3
4
extern "C" void abort();
5
6
int count = 0;
7
8
struct T {
9
T() { count++; }
10
T(const T&) { count++; }
11
~T() { if (count==0) abort(); --count; }
12
};
13
14
struct auto_ptr {
15
T* p;
16
17
auto_ptr(T* __p) : p(__p) { }
18
~auto_ptr() { delete p; }
19
20
T* release() {
21
T* t = p;
22
p = 0;
23
return t;
24
}
25
};
26
27
void destroy (auto_ptr a) {
28
delete a.release();
29
}
30
31
32
int main ()
33
{
34
destroy (new T);
35
}