File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed
cpp/ql/src/semmle/code/cpp Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -214,6 +214,9 @@ abstract class ImplicitConversionFunction extends MemberFunction {
214
214
}
215
215
216
216
/**
217
+ * DEPRECATED: as of C++11 this class does not correspond perfectly with the
218
+ * language definition of a converting constructor.
219
+ *
217
220
* A C++ constructor that also defines an implicit conversion. For example the
218
221
* function `MyClass` in the following code is a `ConversionConstructor`:
219
222
* ```
@@ -225,7 +228,7 @@ abstract class ImplicitConversionFunction extends MemberFunction {
225
228
* };
226
229
* ```
227
230
*/
228
- class ConversionConstructor extends Constructor , ImplicitConversionFunction {
231
+ deprecated class ConversionConstructor extends Constructor , ImplicitConversionFunction {
229
232
ConversionConstructor ( ) {
230
233
strictcount ( Parameter p | p = getAParameter ( ) and not p .hasInitializer ( ) ) = 1 and
231
234
not hasSpecifier ( "explicit" )
Original file line number Diff line number Diff line change @@ -7,9 +7,18 @@ import semmle.code.cpp.models.interfaces.DataFlow
7
7
import semmle.code.cpp.models.interfaces.Taint
8
8
9
9
/**
10
- * Model for C++ conversion constructors.
10
+ * Model for C++ conversion constructors. As of C++11 this does not correspond
11
+ * perfectly with the language definition of a converting constructor, however,
12
+ * it does correspond with the constructors we are confident taint should flow
13
+ * through.
11
14
*/
12
- class ConversionConstructorModel extends ConversionConstructor , TaintFunction {
15
+ class ConversionConstructorModel extends Constructor , TaintFunction {
16
+ ConversionConstructorModel ( )
17
+ {
18
+ strictcount ( Parameter p | p = getAParameter ( ) and not p .hasInitializer ( ) ) = 1 and
19
+ not hasSpecifier ( "explicit" )
20
+ }
21
+
13
22
override predicate hasTaintFlow ( FunctionInput input , FunctionOutput output ) {
14
23
// taint flow from the first constructor argument to the returned object
15
24
input .isParameter ( 0 ) and
You can’t perform that action at this time.
0 commit comments