Skip to content

Commit 391d9be

Browse files
committed
C++: Add deprecated to predicates that are deprecated according to the QLDoc
1 parent 2ee8344 commit 391d9be

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

cpp/ql/lib/semmle/code/cpp/Declaration.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ class Declaration extends Locatable, @declaration {
186186
predicate hasDefinition() { exists(this.getDefinition()) }
187187

188188
/** DEPRECATED: Use `hasDefinition` instead. */
189-
predicate isDefined() { this.hasDefinition() }
189+
deprecated predicate isDefined() { this.hasDefinition() }
190190

191191
/** Gets the preferred location of this declaration, if any. */
192192
override Location getLocation() { none() }

cpp/ql/lib/semmle/code/cpp/Function.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class Function extends Declaration, ControlFlowNode, AccessHolder, @function {
4141
* `min<int>(int, int) -> int`, and the full signature of the uninstantiated
4242
* template on the first line would be `min<T>(T, T) -> T`.
4343
*/
44-
string getFullSignature() {
44+
deprecated string getFullSignature() {
4545
exists(string name, string templateArgs, string args |
4646
result = name + templateArgs + args + " -> " + this.getType().toString() and
4747
name = this.getQualifiedName() and

cpp/ql/lib/semmle/code/cpp/commons/Alloc.qll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ predicate freeFunction(Function f, int argNum) { argNum = f.(DeallocationFunctio
1212
*
1313
* DEPRECATED: Use `DeallocationExpr` instead (this also includes `delete` expressions).
1414
*/
15-
predicate freeCall(FunctionCall fc, Expr arg) { arg = fc.(DeallocationExpr).getFreedExpr() }
15+
deprecated predicate freeCall(FunctionCall fc, Expr arg) {
16+
arg = fc.(DeallocationExpr).getFreedExpr()
17+
}
1618

1719
/**
1820
* Is e some kind of allocation or deallocation (`new`, `alloc`, `realloc`, `delete`, `free` etc)?

0 commit comments

Comments
 (0)