aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaInit.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2010-05-02 22:54:08 +0000
committerAnders Carlsson <andersca@mac.com>2010-05-02 22:54:08 +0000
commit72e96fd181b19b8d01144a685cda6e955584c7ea (patch)
treea915d52ef5da6e941c92801210641100b877c616 /lib/Sema/SemaInit.cpp
parent82929316ccfcc1a7674f12195f93b41c91a28bd4 (diff)
Add an enum to CXXConstructExpr so we can determine if the construction expression constructs a non-virtual or virtual base.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102879 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaInit.cpp')
-rw-r--r--lib/Sema/SemaInit.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp
index 4678822413..5e6aa2c0a6 100644
--- a/lib/Sema/SemaInit.cpp
+++ b/lib/Sema/SemaInit.cpp
@@ -3747,12 +3747,21 @@ InitializationSequence::Perform(Sema &S,
NumExprs,
Kind.getParenRange().getEnd(),
ConstructorInitRequiresZeroInit));
- } else
+ } else {
+ CXXConstructExpr::ConstructionKind ConstructKind =
+ CXXConstructExpr::CK_Complete;
+
+ if (Entity.getKind() == InitializedEntity::EK_Base) {
+ ConstructKind = Entity.getBaseSpecifier()->isVirtual() ?
+ CXXConstructExpr::CK_VirtualBase :
+ CXXConstructExpr::CK_NonVirtualBase;
+ }
CurInit = S.BuildCXXConstructExpr(Loc, Entity.getType(),
Constructor,
move_arg(ConstructorArgs),
ConstructorInitRequiresZeroInit,
- Entity.getKind() == InitializedEntity::EK_Base);
+ ConstructKind);
+ }
if (CurInit.isInvalid())
return S.ExprError();