Files
codeql/cpp/ql/test/library-tests/special_members/detect/detect.ql
Jonas Jensen 4ef5c9af62 C++: Autoformat everything
Some files that will change in #1736 have been spared.

    ./build -j4 target/jars/qlformat
    find ql/cpp/ql -name "*.ql"  -print0 | xargs -0 target/jars/qlformat --input
    find ql/cpp/ql -name "*.qll" -print0 | xargs -0 target/jars/qlformat --input
    (cd ql && git checkout 'cpp/ql/src/semmle/code/cpp/ir/implementation/**/*SSA*.qll')
    buildutils-internal/scripts/pr-checks/sync-identical-files.py --latest
2019-09-09 11:25:53 +02:00

30 lines
929 B
Plaintext

import cpp
string functionName(Function f) {
result = f.getQualifiedName() + "(" + f.getParameterString() + ")"
or
not exists(f.getQualifiedName()) and
result = f.getName() + "(" + f.getParameterString() + ")"
}
from MemberFunction f, string description
where
description = "1 constructor" and
f instanceof Constructor and
not f instanceof CopyConstructor and
not f instanceof MoveConstructor
or
description = "2 copy constructor" and f instanceof CopyConstructor
or
description = "3 move constructor" and f instanceof MoveConstructor
or
description = "4 copy assignment" and f instanceof CopyAssignmentOperator
or
description = "5 move assignment" and f instanceof MoveAssignmentOperator
or
description = "6 none of the above" and
not f instanceof Constructor and
not f instanceof CopyAssignmentOperator and
not f instanceof MoveAssignmentOperator
select description, functionName(f)