2018-11-07 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / g++.dg / opt / rtti2.C
blobebbe3cdfda8d24dbcad753c70ef5ea9b1d821feb
1 // { dg-do compile }
2 // { dg-options "-O2" }
3 // We used to ICE in compare_values as the types for a comparison
4 // were not the same kind of types.
6 struct class1
8   virtual ~class1 ();
9 };
10 struct class2 :  class1 { };
12 void f(class1 * oo)
14   class2 * oj = dynamic_cast <class2 *>(oo) ;
15   if (oj)
16     delete oo;