@@ -13,7 +13,7 @@ import semmle.code.cpp.models.interfaces.Iterator
1313/**
1414 * An instantiation of the `std::iterator_traits` template.
1515 */
16- class IteratorTraits extends Class {
16+ private class IteratorTraits extends Class {
1717 IteratorTraits ( ) {
1818 this .hasQualifiedName ( "std" , "iterator_traits" ) and
1919 not this instanceof TemplateClass and
@@ -29,7 +29,7 @@ class IteratorTraits extends Class {
2929/**
3030 * A type which has the typedefs expected for an iterator.
3131 */
32- class IteratorByTypedefs extends Class {
32+ private class IteratorByTypedefs extends Class {
3333 IteratorByTypedefs ( ) {
3434 this .getAMember ( ) .( TypedefType ) .hasName ( "difference_type" ) and
3535 this .getAMember ( ) .( TypedefType ) .hasName ( "value_type" ) and
@@ -43,7 +43,7 @@ class IteratorByTypedefs extends Class {
4343/**
4444 * The `std::iterator` class.
4545 */
46- class StdIterator extends Class {
46+ private class StdIterator extends Class {
4747 StdIterator ( ) { this .hasQualifiedName ( "std" , "iterator" ) }
4848}
4949
@@ -81,7 +81,7 @@ private FunctionInput getIteratorArgumentInput(Operator op, int index) {
8181/**
8282 * A non-member prefix `operator*` function for an iterator type.
8383 */
84- class IteratorPointerDereferenceOperator extends Operator , TaintFunction , IteratorReferenceFunction {
84+ private class IteratorPointerDereferenceOperator extends Operator , TaintFunction , IteratorReferenceFunction {
8585 FunctionInput iteratorInput ;
8686
8787 IteratorPointerDereferenceOperator ( ) {
@@ -101,7 +101,7 @@ class IteratorPointerDereferenceOperator extends Operator, TaintFunction, Iterat
101101/**
102102 * A non-member `operator++` or `operator--` function for an iterator type.
103103 */
104- class IteratorCrementOperator extends Operator , DataFlowFunction {
104+ private class IteratorCrementOperator extends Operator , DataFlowFunction {
105105 FunctionInput iteratorInput ;
106106
107107 IteratorCrementOperator ( ) {
@@ -118,7 +118,7 @@ class IteratorCrementOperator extends Operator, DataFlowFunction {
118118/**
119119 * A non-member `operator+` function for an iterator type.
120120 */
121- class IteratorAddOperator extends Operator , TaintFunction {
121+ private class IteratorAddOperator extends Operator , TaintFunction {
122122 FunctionInput iteratorInput ;
123123
124124 IteratorAddOperator ( ) {
@@ -135,7 +135,7 @@ class IteratorAddOperator extends Operator, TaintFunction {
135135/**
136136 * A non-member `operator-` function that takes a pointer difference type as its second argument.
137137 */
138- class IteratorSubOperator extends Operator , TaintFunction {
138+ private class IteratorSubOperator extends Operator , TaintFunction {
139139 FunctionInput iteratorInput ;
140140
141141 IteratorSubOperator ( ) {
@@ -153,7 +153,7 @@ class IteratorSubOperator extends Operator, TaintFunction {
153153/**
154154 * A non-member `operator+=` or `operator-=` function for an iterator type.
155155 */
156- class IteratorAssignArithmeticOperator extends Operator , DataFlowFunction , TaintFunction {
156+ private class IteratorAssignArithmeticOperator extends Operator , DataFlowFunction , TaintFunction {
157157 IteratorAssignArithmeticOperator ( ) {
158158 this .hasName ( [ "operator+=" , "operator-=" ] ) and
159159 this .getDeclaringType ( ) instanceof Iterator
@@ -192,7 +192,7 @@ class IteratorPointerDereferenceMemberOperator extends MemberFunction, TaintFunc
192192/**
193193 * An `operator++` or `operator--` member function for an iterator type.
194194 */
195- class IteratorCrementMemberOperator extends MemberFunction , DataFlowFunction , TaintFunction {
195+ private class IteratorCrementMemberOperator extends MemberFunction , DataFlowFunction , TaintFunction {
196196 IteratorCrementMemberOperator ( ) {
197197 this .hasName ( [ "operator++" , "operator--" ] ) and
198198 this .getDeclaringType ( ) instanceof Iterator
@@ -215,7 +215,7 @@ class IteratorCrementMemberOperator extends MemberFunction, DataFlowFunction, Ta
215215/**
216216 * A member `operator->` function for an iterator type.
217217 */
218- class IteratorFieldMemberOperator extends Operator , TaintFunction {
218+ private class IteratorFieldMemberOperator extends Operator , TaintFunction {
219219 IteratorFieldMemberOperator ( ) {
220220 this .hasName ( "operator->" ) and
221221 this .getDeclaringType ( ) instanceof Iterator
@@ -230,7 +230,7 @@ class IteratorFieldMemberOperator extends Operator, TaintFunction {
230230/**
231231 * An `operator+` or `operator-` member function of an iterator class.
232232 */
233- class IteratorBinaryArithmeticMemberOperator extends MemberFunction , TaintFunction {
233+ private class IteratorBinaryArithmeticMemberOperator extends MemberFunction , TaintFunction {
234234 IteratorBinaryArithmeticMemberOperator ( ) {
235235 this .hasName ( [ "operator+" , "operator-" ] ) and
236236 this .getDeclaringType ( ) instanceof Iterator
@@ -245,7 +245,7 @@ class IteratorBinaryArithmeticMemberOperator extends MemberFunction, TaintFuncti
245245/**
246246 * An `operator+=` or `operator-=` member function of an iterator class.
247247 */
248- class IteratorAssignArithmeticMemberOperator extends MemberFunction , DataFlowFunction , TaintFunction {
248+ private class IteratorAssignArithmeticMemberOperator extends MemberFunction , DataFlowFunction , TaintFunction {
249249 IteratorAssignArithmeticMemberOperator ( ) {
250250 this .hasName ( [ "operator+=" , "operator-=" ] ) and
251251 this .getDeclaringType ( ) instanceof Iterator
@@ -268,7 +268,7 @@ class IteratorAssignArithmeticMemberOperator extends MemberFunction, DataFlowFun
268268/**
269269 * An `operator[]` member function of an iterator class.
270270 */
271- class IteratorArrayMemberOperator extends MemberFunction , TaintFunction , IteratorReferenceFunction {
271+ private class IteratorArrayMemberOperator extends MemberFunction , TaintFunction , IteratorReferenceFunction {
272272 IteratorArrayMemberOperator ( ) {
273273 this .hasName ( "operator[]" ) and
274274 this .getDeclaringType ( ) instanceof Iterator
@@ -287,7 +287,7 @@ class IteratorArrayMemberOperator extends MemberFunction, TaintFunction, Iterato
287287 * The `hasTaintFlow` override provides flow through output iterators that return themselves with
288288 * `operator*` and use their own `operator=` to assign to the container.
289289 */
290- class IteratorAssignmentMemberOperator extends MemberFunction , TaintFunction {
290+ private class IteratorAssignmentMemberOperator extends MemberFunction , TaintFunction {
291291 IteratorAssignmentMemberOperator ( ) {
292292 this .hasName ( "operator=" ) and
293293 this .getDeclaringType ( ) instanceof Iterator and
@@ -305,7 +305,7 @@ class IteratorAssignmentMemberOperator extends MemberFunction, TaintFunction {
305305 * A `begin` or `end` member function, or a related member function, that
306306 * returns an iterator.
307307 */
308- class BeginOrEndFunction extends MemberFunction , TaintFunction , GetIteratorFunction {
308+ private class BeginOrEndFunction extends MemberFunction , TaintFunction , GetIteratorFunction {
309309 BeginOrEndFunction ( ) {
310310 this
311311 .hasName ( [ "begin" , "cbegin" , "rbegin" , "crbegin" , "end" , "cend" , "rend" , "crend" ,
@@ -328,7 +328,7 @@ class BeginOrEndFunction extends MemberFunction, TaintFunction, GetIteratorFunct
328328 * The `std::front_inserter`, `std::inserter`, and `std::back_inserter`
329329 * functions.
330330 */
331- class InserterIteratorFunction extends GetIteratorFunction {
331+ private class InserterIteratorFunction extends GetIteratorFunction {
332332 InserterIteratorFunction ( ) {
333333 this .hasQualifiedName ( "std" , [ "front_inserter" , "inserter" , "back_inserter" ] )
334334 }
0 commit comments