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