Skip to content

Commit 2c58279

Browse files
committed
C++: Add QLDoc to 'isClassConstructedFrom' and 'isFunctionConstructedFrom'.
1 parent 3c0af49 commit 2c58279

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

cpp/ql/lib/semmle/code/cpp/dataflow/ExternalFlow.qll

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,12 +434,30 @@ private predicate elementSpec(
434434
summaryModel(namespace, type, subtypes, name, signature, ext, _, _, _, _, _)
435435
}
436436

437+
/**
438+
* Holds if `c` is an instantiation of a class template `templateClass`, or
439+
* holds with `c = templateClass` if `c` is not an instantiation of any class
440+
* template.
441+
*
442+
* This predicate is used instead of `Class.isConstructedFrom` (which only
443+
* holds for template instantiations) in this file to allow for uniform
444+
* treatment of non-templated classes and class template instantiations.
445+
*/
437446
private predicate isClassConstructedFrom(Class c, Class templateClass) {
438447
c.isConstructedFrom(templateClass)
439448
or
440449
not c.isConstructedFrom(_) and c = templateClass
441450
}
442451

452+
/**
453+
* Holds if `f` is an instantiation of a function template `templateFunc`, or
454+
* holds with `f = templateFunc` if `f` is not an instantiation of any function
455+
* template.
456+
*
457+
* This predicate is used instead of `Function.isConstructedFrom` (which only
458+
* holds for template instantiations) in this file to allow for uniform
459+
* treatment of non-templated classes and class template instantiations.
460+
*/
443461
private predicate isFunctionConstructedFrom(Function f, Function templateFunc) {
444462
f.isConstructedFrom(templateFunc)
445463
or

0 commit comments

Comments
 (0)