File tree Expand file tree Collapse file tree
cpp/ql/src/semmle/code/cpp Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -214,6 +214,9 @@ abstract class ImplicitConversionFunction extends MemberFunction {
214214}
215215
216216/**
217+ * DEPRECATED: as of C++11 this class does not correspond perfectly with the
218+ * language definition of a converting constructor.
219+ *
217220 * A C++ constructor that also defines an implicit conversion. For example the
218221 * function `MyClass` in the following code is a `ConversionConstructor`:
219222 * ```
@@ -225,7 +228,7 @@ abstract class ImplicitConversionFunction extends MemberFunction {
225228 * };
226229 * ```
227230 */
228- class ConversionConstructor extends Constructor , ImplicitConversionFunction {
231+ deprecated class ConversionConstructor extends Constructor , ImplicitConversionFunction {
229232 ConversionConstructor ( ) {
230233 strictcount ( Parameter p | p = getAParameter ( ) and not p .hasInitializer ( ) ) = 1 and
231234 not hasSpecifier ( "explicit" )
Original file line number Diff line number Diff line change @@ -7,9 +7,18 @@ import semmle.code.cpp.models.interfaces.DataFlow
77import semmle.code.cpp.models.interfaces.Taint
88
99/**
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.
1114 */
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+
1322 override predicate hasTaintFlow ( FunctionInput input , FunctionOutput output ) {
1423 // taint flow from the first constructor argument to the returned object
1524 input .isParameter ( 0 ) and
You can’t perform that action at this time.
0 commit comments