Sign in
gnu
/
gcc
/
ab810952eb7c061e37054ddd1dfe0aa033365131
/
.
/
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
;
}