File tree Expand file tree Collapse file tree 6 files changed +74
-58
lines changed Expand file tree Collapse file tree 6 files changed +74
-58
lines changed Original file line number Diff line number Diff line change @@ -27,9 +27,9 @@ public MultipleInheritancePass()
2727 VisitOptions . VisitFunctionParameters = false ;
2828 }
2929
30- public override bool VisitTranslationUnit ( TranslationUnit unit )
30+ public override bool VisitASTContext ( ASTContext context )
3131 {
32- bool result = base . VisitTranslationUnit ( unit ) ;
32+ bool result = base . VisitASTContext ( context ) ;
3333 foreach ( var @interface in interfaces . Where ( i => ! ( i is ClassTemplateSpecialization ) ) )
3434 {
3535 int index = @interface . Namespace . Declarations . IndexOf ( @interface . OriginalClass ) ;
Original file line number Diff line number Diff line change 11#include " AnotherUnit.h"
22
3+ void SecondaryBase::VirtualMember ()
4+ {
5+ }
6+
7+ int SecondaryBase::property ()
8+ {
9+ return 0 ;
10+ }
11+
12+ void SecondaryBase::setProperty (int value)
13+ {
14+ }
15+
16+ void SecondaryBase::function (bool * ok)
17+ {
18+ }
19+
20+ void SecondaryBase::protectedFunction ()
21+ {
22+ }
23+
24+ int SecondaryBase::protectedProperty ()
25+ {
26+ return 0 ;
27+ }
28+
29+ void SecondaryBase::setProtectedProperty (int value)
30+ {
31+ }
32+
333void functionInAnotherUnit ()
434{
535}
636
37+ MultipleInheritance::MultipleInheritance ()
38+ {
39+ }
40+
41+ MultipleInheritance::~MultipleInheritance ()
42+ {
43+ }
44+
745namespace HasFreeConstant
846{
947 extern const int DLL_API FREE_CONSTANT_IN_NAMESPACE = 5 ;
Original file line number Diff line number Diff line change 33
44#pragma once
55
6+ class DLL_API SecondaryBase
7+ {
8+ public:
9+ enum Property
10+ {
11+ P1,
12+ P2
13+ };
14+ enum Function
15+ {
16+ M1,
17+ M2
18+ };
19+
20+ virtual void VirtualMember ();
21+ int property ();
22+ void setProperty (int value);
23+ void function (bool * ok = 0 );
24+ typedef void HasPointerToEnum (Property* pointerToEnum);
25+ HasPointerToEnum* hasPointerToEnum;
26+ protected:
27+ void protectedFunction ();
28+ int protectedProperty ();
29+ void setProtectedProperty (int value);
30+ };
31+
632void DLL_API functionInAnotherUnit ();
733
834struct DLL_API ForwardDeclaredStruct;
@@ -19,6 +45,13 @@ class ForwardInOtherUnitButSameModule
1945{
2046};
2147
48+ class DLL_API MultipleInheritance : ForwardInOtherUnitButSameModule, SecondaryBase
49+ {
50+ public:
51+ MultipleInheritance ();
52+ ~MultipleInheritance ();
53+ };
54+
2255namespace HasFreeConstant
2356{
2457 extern const int DLL_API FREE_CONSTANT_IN_NAMESPACE;
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ public void TestUncompilableCode()
2323#pragma warning disable 0219 // warning CS0219: The variable `foo' is assigned but its value is never used
2424
2525 ALLCAPS_UNDERSCORES a ;
26+ new MultipleInheritance ( ) . Dispose ( ) ;
2627 using ( var testRenaming = new TestRenaming ( ) )
2728 {
2829 testRenaming . name ( ) ;
Original file line number Diff line number Diff line change @@ -839,36 +839,6 @@ HasVirtualDtor1* CallDtorVirtually::getHasVirtualDtor1(HasVirtualDtor1* returned
839839 return returned;
840840}
841841
842- void SecondaryBase::VirtualMember ()
843- {
844- }
845-
846- int SecondaryBase::property ()
847- {
848- return 0 ;
849- }
850-
851- void SecondaryBase::setProperty (int value)
852- {
853- }
854-
855- void SecondaryBase::function (bool * ok)
856- {
857- }
858-
859- void SecondaryBase::protectedFunction ()
860- {
861- }
862-
863- int SecondaryBase::protectedProperty ()
864- {
865- return 0 ;
866- }
867-
868- void SecondaryBase::setProtectedProperty (int value)
869- {
870- }
871-
872842TestOverrideFromSecondaryBase::TestOverrideFromSecondaryBase ()
873843{
874844}
Original file line number Diff line number Diff line change @@ -684,32 +684,6 @@ class HasProtectedNestedAnonymousType
684684 } u;
685685};
686686
687- class DLL_API SecondaryBase
688- {
689- public:
690- enum Property
691- {
692- P1,
693- P2
694- };
695- enum Function
696- {
697- M1,
698- M2
699- };
700-
701- virtual void VirtualMember ();
702- int property ();
703- void setProperty (int value);
704- void function (bool * ok = 0 );
705- typedef void HasPointerToEnum (Property* pointerToEnum);
706- HasPointerToEnum* hasPointerToEnum;
707- protected:
708- void protectedFunction ();
709- int protectedProperty ();
710- void setProtectedProperty (int value);
711- };
712-
713687class DLL_API TestOverrideFromSecondaryBase : public Foo, public SecondaryBase
714688{
715689public:
You can’t perform that action at this time.
0 commit comments