@@ -781,21 +781,53 @@ void fVirtualDiamondInheritanceTest3() {
781
781
// Dynamic type test.
782
782
// ===----------------------------------------------------------------------===//
783
783
784
- struct DynTBase {};
785
- struct DynTDerived : DynTBase {
786
- // TODO: we'd expect the note: {{uninitialized field 'this->x'}}
787
- int x; // no-note
784
+ struct DynTBase1 {};
785
+ struct DynTDerived1 : DynTBase1 {
786
+ int y; // expected-note{{uninitialized field 'static_cast<struct DynTDerived1 *>(this->bptr)->y'}}
788
787
};
789
788
790
- struct DynamicTypeTest {
791
- DynTBase *bptr;
789
+ struct DynamicTypeTest1 {
790
+ DynTBase1 *bptr;
792
791
int i = 0 ;
793
792
794
- // TODO: we'd expect the warning: {{1 uninitialized field}}
795
- DynamicTypeTest (DynTBase *bptr) : bptr(bptr) {} // no-warning
793
+ DynamicTypeTest1 (DynTBase1 *bptr) : bptr(bptr) {} // expected-warning{{1 uninitialized field}}
796
794
};
797
795
798
- void f () {
799
- DynTDerived d;
800
- DynamicTypeTest t (&d);
796
+ void fDynamicTypeTest1 () {
797
+ DynTDerived1 d;
798
+ DynamicTypeTest1 t (&d);
801
799
};
800
+
801
+ struct DynTBase2 {
802
+ int x; // expected-note{{uninitialized field 'static_cast<struct DynTDerived2 *>(this->bptr)->DynTBase2::x'}}
803
+ };
804
+ struct DynTDerived2 : DynTBase2 {
805
+ int y; // expected-note{{uninitialized field 'static_cast<struct DynTDerived2 *>(this->bptr)->y'}}
806
+ };
807
+
808
+ struct DynamicTypeTest2 {
809
+ DynTBase2 *bptr;
810
+ int i = 0 ;
811
+
812
+ DynamicTypeTest2 (DynTBase2 *bptr) : bptr(bptr) {} // expected-warning{{2 uninitialized fields}}
813
+ };
814
+
815
+ void fDynamicTypeTest2 () {
816
+ DynTDerived2 d;
817
+ DynamicTypeTest2 t (&d);
818
+ }
819
+
820
+ struct SymbolicSuperRegionBase {
821
+ SymbolicSuperRegionBase () {}
822
+ };
823
+
824
+ struct SymbolicSuperRegionDerived : SymbolicSuperRegionBase {
825
+ SymbolicSuperRegionBase *bptr; // no-crash
826
+ SymbolicSuperRegionDerived (SymbolicSuperRegionBase *bptr) : bptr(bptr) {}
827
+ };
828
+
829
+ SymbolicSuperRegionDerived *getSymbolicRegion ();
830
+
831
+ void fSymbolicSuperRegionTest () {
832
+ SymbolicSuperRegionDerived test (getSymbolicRegion ());
833
+ }
0 commit comments