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()
27
27
VisitOptions . VisitFunctionParameters = false ;
28
28
}
29
29
30
- public override bool VisitTranslationUnit ( TranslationUnit unit )
30
+ public override bool VisitASTContext ( ASTContext context )
31
31
{
32
- bool result = base . VisitTranslationUnit ( unit ) ;
32
+ bool result = base . VisitASTContext ( context ) ;
33
33
foreach ( var @interface in interfaces . Where ( i => ! ( i is ClassTemplateSpecialization ) ) )
34
34
{
35
35
int index = @interface . Namespace . Declarations . IndexOf ( @interface . OriginalClass ) ;
Original file line number Diff line number Diff line change 1
1
#include " AnotherUnit.h"
2
2
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
+
3
33
void functionInAnotherUnit ()
4
34
{
5
35
}
6
36
37
+ MultipleInheritance::MultipleInheritance ()
38
+ {
39
+ }
40
+
41
+ MultipleInheritance::~MultipleInheritance ()
42
+ {
43
+ }
44
+
7
45
namespace HasFreeConstant
8
46
{
9
47
extern const int DLL_API FREE_CONSTANT_IN_NAMESPACE = 5 ;
Original file line number Diff line number Diff line change 3
3
4
4
#pragma once
5
5
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
+
6
32
void DLL_API functionInAnotherUnit ();
7
33
8
34
struct DLL_API ForwardDeclaredStruct;
@@ -19,6 +45,13 @@ class ForwardInOtherUnitButSameModule
19
45
{
20
46
};
21
47
48
+ class DLL_API MultipleInheritance : ForwardInOtherUnitButSameModule, SecondaryBase
49
+ {
50
+ public:
51
+ MultipleInheritance ();
52
+ ~MultipleInheritance ();
53
+ };
54
+
22
55
namespace HasFreeConstant
23
56
{
24
57
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()
23
23
#pragma warning disable 0219 // warning CS0219: The variable `foo' is assigned but its value is never used
24
24
25
25
ALLCAPS_UNDERSCORES a ;
26
+ new MultipleInheritance ( ) . Dispose ( ) ;
26
27
using ( var testRenaming = new TestRenaming ( ) )
27
28
{
28
29
testRenaming . name ( ) ;
Original file line number Diff line number Diff line change @@ -839,36 +839,6 @@ HasVirtualDtor1* CallDtorVirtually::getHasVirtualDtor1(HasVirtualDtor1* returned
839
839
return returned;
840
840
}
841
841
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
-
872
842
TestOverrideFromSecondaryBase::TestOverrideFromSecondaryBase ()
873
843
{
874
844
}
Original file line number Diff line number Diff line change @@ -684,32 +684,6 @@ class HasProtectedNestedAnonymousType
684
684
} u;
685
685
};
686
686
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
-
713
687
class DLL_API TestOverrideFromSecondaryBase : public Foo, public SecondaryBase
714
688
{
715
689
public:
You can’t perform that action at this time.
0 commit comments