Sign in
gnu
/
gcc
/
1f16a020acbea0af26209478990b83b1a1ba3a2b
/
.
/
gcc
/
testsuite
/
g++.dg
/
template
/
new11.C
blob: 76f6c66997f5ba14511e4a09a6144e39eba6aa94 [
file
] [
log
] [
blame
]
// PR c++/54984
// { dg-do run }
int
n
=
1
;
void
*
operator
new
(
__SIZE_TYPE__
)
{
n
=
-
1
;
return
&
n
;
}
template
<
class
T
>
struct
Foo
{
Foo
()
:
x
(
new
int
)
{
if
(*
x
!=
-
1
)
__builtin_abort
();
}
int
*
x
;
};
int
main
()
{
Foo
<float>
foo
;
}