@@ -45,32 +45,36 @@ class BasicStringMemberFunctionDereferencedExpr extends BasicStringDereferencedE
45
45
|
46
46
// basic_string::basic_string(const charT *, const Allocator &)
47
47
f instanceof Constructor and
48
- f .getNumberOfParameters ( ) = 2 and
48
+ f .getNumberOfParameters ( ) < = 2 and
49
49
f .getParameter ( 0 ) .getType ( ) = stringType .getConstCharTPointer ( ) and
50
- f .getParameter ( 1 ) .getType ( ) = stringType .getConstAllocatorReferenceType ( ) and
50
+ (
51
+ f .getNumberOfParameters ( ) = 2
52
+ implies
53
+ f .getParameter ( 1 ) .getType ( ) = stringType .getConstAllocatorReferenceType ( )
54
+ ) and
51
55
this = fc .getArgument ( 0 )
52
56
or
53
57
// basic_string &basic_string::append(const charT *)
54
58
// basic_string &basic_string::assign(const charT *)
55
59
f .hasName ( [ "append" , "assign" ] ) and
56
60
f .getNumberOfParameters ( ) = 1 and
57
- f . getParameter ( 0 ) .getType ( ) = stringType .getConstCharTPointer ( ) and
61
+ fc . getArgument ( 0 ) .getType ( ) = stringType .getConstCharTPointer ( ) and
58
62
this = fc .getArgument ( 0 )
59
63
or
60
64
// basic_string &basic_string::insert(size_type, const charT *)
61
65
f .hasName ( "insert" ) and
62
66
f .getNumberOfParameters ( ) = 2 and
63
- f . getParameter ( 0 ) .getType ( ) = stringType .getSizeType ( ) and
64
- f . getParameter ( 1 ) .getType ( ) = stringType .getConstCharTPointer ( ) and
67
+ fc . getArgument ( 0 ) .getType ( ) = stringType .getSizeType ( ) and
68
+ fc . getArgument ( 1 ) .getType ( ) = stringType .getConstCharTPointer ( ) and
65
69
this = fc .getArgument ( 1 )
66
70
or
67
71
// basic_string &basic_string::replace(size_type, size_type, const charT *)
68
72
// basic_string &basic_string::replace(const_iterator, const_iterator, const charT *)
69
73
f .hasName ( "replace" ) and
70
74
f .getNumberOfParameters ( ) = 3 and
71
- f . getParameter ( 0 ) .getType ( ) = [ stringType .getSizeType ( ) , stringType .getConstIteratorType ( ) ] and
72
- f . getParameter ( 1 ) .getType ( ) = [ stringType .getSizeType ( ) , stringType .getConstIteratorType ( ) ] and
73
- f . getParameter ( 2 ) .getType ( ) = stringType .getConstCharTPointer ( ) and
75
+ fc . getArgument ( 0 ) .getType ( ) = [ stringType .getSizeType ( ) , stringType .getConstIteratorType ( ) ] and
76
+ fc . getArgument ( 1 ) .getType ( ) = [ stringType .getSizeType ( ) , stringType .getConstIteratorType ( ) ] and
77
+ fc . getArgument ( 2 ) .getType ( ) = stringType .getConstCharTPointer ( ) and
74
78
this = fc .getArgument ( 2 )
75
79
or
76
80
// size_type basic_string::find(const charT *, size_type)
@@ -83,24 +87,24 @@ class BasicStringMemberFunctionDereferencedExpr extends BasicStringDereferencedE
83
87
"find" , "rfind" , "find_first_of" , "find_last_of" , "find_first_not_of" , "find_last_not_of"
84
88
] ) and
85
89
f .getNumberOfParameters ( ) = 2 and
86
- f . getParameter ( 0 ) .getType ( ) = stringType .getConstCharTPointer ( ) and
87
- f . getParameter ( 1 ) .getType ( ) = stringType .getSizeType ( ) and
90
+ fc . getArgument ( 0 ) .getType ( ) = stringType .getConstCharTPointer ( ) and
91
+ fc . getArgument ( 1 ) .getType ( ) = stringType .getSizeType ( ) and
88
92
this = fc .getArgument ( 0 )
89
93
or
90
94
// int basic_string::compare(const charT *)
91
95
// basic_string &basic_string::operator=(const charT *)
92
96
// basic_string &basic_string::operator+=(const charT *)
93
97
f .hasName ( [ "compare" , "operator=" , "operator+=" ] ) and
94
98
f .getNumberOfParameters ( ) = 1 and
95
- f . getParameter ( 0 ) .getType ( ) = stringType .getConstCharTPointer ( ) and
99
+ fc . getArgument ( 0 ) .getType ( ) = stringType .getConstCharTPointer ( ) and
96
100
this = fc .getArgument ( 0 )
97
101
or
98
102
// int basic_string::compare(size_type, size_type, const charT *)
99
103
f .hasName ( "compare" ) and
100
104
f .getNumberOfParameters ( ) = 3 and
101
- f . getParameter ( 0 ) .getType ( ) = stringType .getSizeType ( ) and
102
- f . getParameter ( 1 ) .getType ( ) = stringType .getSizeType ( ) and
103
- f . getParameter ( 2 ) .getType ( ) = stringType .getConstCharTPointer ( ) and
105
+ fc . getArgument ( 0 ) .getType ( ) = stringType .getSizeType ( ) and
106
+ fc . getArgument ( 1 ) .getType ( ) = stringType .getSizeType ( ) and
107
+ fc . getArgument ( 2 ) .getType ( ) = stringType .getConstCharTPointer ( ) and
104
108
this = fc .getArgument ( 2 )
105
109
)
106
110
}
@@ -132,7 +136,7 @@ class BasicStringNonMemberFunctionDereferencedExpr extends BasicStringDereferenc
132
136
] ) and
133
137
f .getAParameter ( ) .getType ( ) .( ReferenceType ) .getBaseType ( ) .getUnspecifiedType ( ) = stringType and
134
138
exists ( int param |
135
- f . getParameter ( param ) .getType ( ) = stringType .getConstCharTPointer ( ) and
139
+ fc . getArgument ( param ) .getType ( ) = stringType .getConstCharTPointer ( ) and
136
140
this = fc .getArgument ( param )
137
141
)
138
142
)
0 commit comments