Sign in
gnu
/
gcc
/
d769c5040874bf9546f2524f3f1d2a894165f92a
/
.
/
gcc
/
testsuite
/
g++.dg
/
rtti
/
typeid11.C
blob: 384b0f417054e2bca3524345f26fd0dfe900117c [
file
] [
log
] [
blame
]
// { dg-do run }
#include
<typeinfo>
struct
Base
{
virtual
void
foo
()
{}
};
// polymorphic
int
main
()
{
Base
b
;
Base
*
ary
[]
=
{
&
b
,
&
b
,
&
b
};
int
iter
=
0
;
typeid
(*
ary
[
iter
++]);
if
(
iter
!=
1
)
// should be 1
__builtin_abort
();
// but 2
}