forked from OSchip/llvm-project
Fix handling of constructor inherited through multiple levels of virtual base class.
llvm-svn: 285446
This commit is contained in:
parent
a9272314b9
commit
a99fa39c41
|
@ -2957,11 +2957,10 @@ class ConstructorUsingShadowDecl final : public UsingShadowDecl {
|
|||
dyn_cast<ConstructorUsingShadowDecl>(Target)),
|
||||
ConstructedBaseClassShadowDecl(NominatedBaseClassShadowDecl),
|
||||
IsVirtual(TargetInVirtualBase) {
|
||||
// If we found a constructor for a non-virtual base class, but it chains to
|
||||
// a constructor for a virtual base, we should directly call the virtual
|
||||
// base constructor instead.
|
||||
// If we found a constructor that chains to a constructor for a virtual
|
||||
// base, we should directly call that virtual base constructor instead.
|
||||
// FIXME: This logic belongs in Sema.
|
||||
if (!TargetInVirtualBase && NominatedBaseClassShadowDecl &&
|
||||
if (NominatedBaseClassShadowDecl &&
|
||||
NominatedBaseClassShadowDecl->constructsVirtualBase()) {
|
||||
ConstructedBaseClassShadowDecl =
|
||||
NominatedBaseClassShadowDecl->ConstructedBaseClassShadowDecl;
|
||||
|
|
|
@ -87,6 +87,13 @@ namespace vbase {
|
|||
D d2(0, 0); // expected-error {{deleted}}
|
||||
}
|
||||
|
||||
namespace vbase_of_vbase {
|
||||
struct V { V(int); };
|
||||
struct W : virtual V { using V::V; };
|
||||
struct X : virtual W, virtual V { using W::W; };
|
||||
X x(0);
|
||||
}
|
||||
|
||||
namespace constexpr_init_order {
|
||||
struct Param;
|
||||
struct A {
|
||||
|
|
Loading…
Reference in New Issue