Skip to content

Commit 05bf86a

Browse files
authored
Merge pull request github#11126 from hvitved/cpp/position-overrides
C++: Let `(Indirect|Direct)Position` be sub classes of `Position`
2 parents 265838a + 95835b8 commit 05bf86a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,16 +98,16 @@ class ParameterPosition = Position;
9898
/** An argument position represented by an integer. */
9999
class ArgumentPosition = Position;
100100

101-
class Position extends TPosition {
101+
abstract class Position extends TPosition {
102102
abstract string toString();
103103
}
104104

105-
class DirectPosition extends TDirectPosition {
105+
class DirectPosition extends Position, TDirectPosition {
106106
int index;
107107

108108
DirectPosition() { this = TDirectPosition(index) }
109109

110-
string toString() {
110+
override string toString() {
111111
index = -1 and
112112
result = "this"
113113
or
@@ -118,12 +118,12 @@ class DirectPosition extends TDirectPosition {
118118
int getIndex() { result = index }
119119
}
120120

121-
class IndirectionPosition extends TIndirectionPosition {
121+
class IndirectionPosition extends Position, TIndirectionPosition {
122122
int index;
123123

124124
IndirectionPosition() { this = TIndirectionPosition(index) }
125125

126-
string toString() {
126+
override string toString() {
127127
index = -1 and
128128
result = "this"
129129
or

0 commit comments

Comments
 (0)