Correctly initialize the PrimaryBaseInfo if a base is null. Fixes PR5832.

llvm-svn: 91748
This commit is contained in:
Anders Carlsson 2009-12-19 02:13:41 +00:00
parent 7173903ea6
commit 6fda43f4c1
2 changed files with 9 additions and 1 deletions

View File

@ -53,7 +53,7 @@ public:
PrimaryBaseInfo() {}
PrimaryBaseInfo(const CXXRecordDecl *Base, bool IsVirtual)
: Value(Base, IsVirtual) {}
: Value(Base, Base && IsVirtual) {}
/// Value - Points to the primary base. The single-bit value
/// will be non-zero when the primary base is virtual.

View File

@ -9,3 +9,11 @@ void f(A *a) {
// CHECK: call void %
a->f('c');
}
struct B : virtual A {
virtual void f();
};
void f(B * b) {
b->f();
}