2018-11-07 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / g++.dg / opt / rtti1.C
blob32daaefa644759d78a26867c1809c90f7c8cb18e
1 // Test that typeid sees through references even when optimizing.
2 // { dg-do run }
3 // { dg-options "-O2" }
5 #include <typeinfo>
7 struct A
9   virtual ~A() { }
12 class B : public A { };
14 int main ()
16   B b;
17   A &aref = b;
19   return typeid (aref) != typeid (b);