summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/opt/rtti2.C
blob: ebbe3cdfda8d24dbcad753c70ef5ea9b1d821feb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// { dg-do compile }
// { dg-options "-O2" }
// We used to ICE in compare_values as the types for a comparison
// were not the same kind of types.

struct class1
{
  virtual ~class1 ();
};
struct class2 :  class1 { };

void f(class1 * oo)
{
  class2 * oj = dynamic_cast <class2 *>(oo) ;
  if (oj)
    delete oo;
}