Skip to content

Commit c57c016

Browse files
committed
C++: Go the other way.
1 parent dd19ee4 commit c57c016

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

cpp/ql/src/semmle/code/cpp/MemberFunction.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,12 +220,12 @@ abstract class ImplicitConversionFunction extends MemberFunction {
220220
class ConversionConstructor extends Constructor, ImplicitConversionFunction {
221221
ConversionConstructor() {
222222
strictcount(Parameter p | p = getAParameter() and not p.hasInitializer()) = 1 and
223-
not hasSpecifier("explicit") and
224-
not this instanceof CopyConstructor and
225-
not this instanceof MoveConstructor
223+
not hasSpecifier("explicit")
226224
}
227225

228226
override string getCanonicalQLClass() {
227+
not this instanceof CopyConstructor and
228+
not this instanceof MoveConstructor and
229229
result = "ConversionConstructor"
230230
}
231231

cpp/ql/test/library-tests/functions/functions/Functions2.expected

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
| functions.cpp:7:8:7:8 | A | Struct | functions.cpp:11:7:11:8 | ag | |
1313
| functions.cpp:19:7:19:10 | Name | Class | functions.cpp:19:7:19:7 | operator= | |
1414
| functions.cpp:19:7:19:10 | Name | Class | functions.cpp:19:7:19:7 | operator= | |
15-
| functions.cpp:23:7:23:11 | Table | Class | functions.cpp:23:7:23:7 | Table | Constructor, CopyConstructor, getAConstructor() |
15+
| functions.cpp:23:7:23:11 | Table | Class | functions.cpp:23:7:23:7 | Table | Constructor, ConversionConstructor, CopyConstructor, getAConstructor() |
1616
| functions.cpp:23:7:23:11 | Table | Class | functions.cpp:23:7:23:7 | operator= | |
1717
| functions.cpp:23:7:23:11 | Table | Class | functions.cpp:27:3:27:7 | Table | Constructor, getAConstructor() |
1818
| functions.cpp:23:7:23:11 | Table | Class | functions.cpp:28:3:28:8 | ~Table | Destructor, getDestructor() |
@@ -21,6 +21,6 @@
2121
| functions.cpp:33:7:33:13 | MyClass | Class | functions.cpp:33:7:33:7 | operator= | |
2222
| functions.cpp:33:7:33:13 | MyClass | Class | functions.cpp:36:2:36:8 | MyClass | Constructor, NoArgConstructor, getAConstructor() |
2323
| functions.cpp:33:7:33:13 | MyClass | Class | functions.cpp:37:2:37:8 | MyClass | Constructor, ConversionConstructor, getAConstructor() |
24-
| functions.cpp:33:7:33:13 | MyClass | Class | functions.cpp:38:2:38:8 | MyClass | Constructor, CopyConstructor, getAConstructor() |
25-
| functions.cpp:33:7:33:13 | MyClass | Class | functions.cpp:39:2:39:8 | MyClass | Constructor, MoveConstructor, getAConstructor() |
24+
| functions.cpp:33:7:33:13 | MyClass | Class | functions.cpp:38:2:38:8 | MyClass | Constructor, ConversionConstructor, CopyConstructor, getAConstructor() |
25+
| functions.cpp:33:7:33:13 | MyClass | Class | functions.cpp:39:2:39:8 | MyClass | Constructor, ConversionConstructor, MoveConstructor, getAConstructor() |
2626
| functions.cpp:33:7:33:13 | MyClass | Class | functions.cpp:40:2:40:13 | operator int | ConversionOperator |

0 commit comments

Comments
 (0)