diff options
| -rw-r--r-- | clang/include/clang/AST/RecordLayout.h | 2 | ||||
| -rw-r--r-- | clang/test/CodeGenCXX/virtual-function-calls.cpp | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/clang/include/clang/AST/RecordLayout.h b/clang/include/clang/AST/RecordLayout.h index a8334b69408..e8d1788ded8 100644 --- a/clang/include/clang/AST/RecordLayout.h +++ b/clang/include/clang/AST/RecordLayout.h @@ -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. diff --git a/clang/test/CodeGenCXX/virtual-function-calls.cpp b/clang/test/CodeGenCXX/virtual-function-calls.cpp index b927dec8f10..0b3a684301e 100644 --- a/clang/test/CodeGenCXX/virtual-function-calls.cpp +++ b/clang/test/CodeGenCXX/virtual-function-calls.cpp @@ -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(); +}
\ No newline at end of file |

