1 // RUN: %clang_cc1 %s -I%S -triple=x86_64-apple-darwin10 -emit-llvm-only -O3 2 3 // Check that we don't assert on this case. 4 namespace Test1 { 5 6 struct Incomplete; 7 8 struct A { 9 virtual void f(); 10 virtual void g(Incomplete); 11 virtual void h(); 12 virtual void i(); 13 int a; 14 }; 15 16 struct B { 17 virtual void f(); 18 virtual void g(Incomplete); 19 virtual void h(); 20 virtual void i(); 21 int b; 22 }; 23 24 struct C : A, B { 25 C(); 26 27 virtual void f(); 28 virtual void g(Incomplete); 29 virtual void h(); 30 virtual void i(); 31 }; 32 33 void C::h() { } 34 35 C::C() { } 36 37 void C::i() { } 38 39 } 40 41 namespace Test2 { 42 43 struct A { 44 virtual void f(); 45 int a; 46 }; 47 48 struct B { 49 virtual void f(); 50 int b; 51 }; 52 53 struct C : A, B { 54 virtual void f(); 55 }; 56 57 static void f(B* b) { 58 b->f(); 59 } 60 61 } 62 63 // Test that we don't assert. 64 namespace Test3 { 65 66 struct A { 67 virtual ~A(); 68 69 int a; 70 }; 71 72 struct B : A { }; 73 struct C : virtual B { }; 74 75 void f() { 76 C c; 77 } 78 79 } 80