Skip to content

Commit ce5653a

Browse files
committed
C++: Tweak qldoc for declaration names
1 parent ae80b8d commit ce5653a

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

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

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,24 @@ abstract class Declaration extends Locatable, @declaration {
8787

8888
override string toString() { result = this.getName() }
8989

90-
/** Gets the name of this declaration. */
90+
/**
91+
* Gets the name of this declaration.
92+
*
93+
* This name doesn't include a namespace or any argument types, so
94+
* for example both functions `::open()` and `::std::ifstream::open(...)`
95+
* have the same name.
96+
*
97+
* To get the name including the namespace, use `getQualifiedName` or
98+
* `hasQualifiedName`.
99+
*
100+
* To test whether this declaration has a particular name in the global
101+
* namespace, use `hasGlobalName`.
102+
*/
91103
abstract string getName();
104+
/** Holds if this declaration has the given name. */
92105
predicate hasName(string name) { name = this.getName() }
93106

94-
/** Holds if this element has the given name in the global namespace. */
107+
/** Holds if this declaration has the given name in the global namespace. */
95108
predicate hasGlobalName(string name) {
96109
hasName(name)
97110
and getNamespace() instanceof GlobalNamespace

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

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,6 @@ private import semmle.code.cpp.internal.ResolveClass
1717
* in more detail in `Declaration.qll`.
1818
*/
1919
class Function extends Declaration, ControlFlowNode, AccessHolder, @function {
20-
21-
/**
22-
* Gets the name of this function.
23-
*
24-
* This name doesn't include a namespace or any argument types, so both
25-
* `::open()` and `::std::ifstream::open(...)` have the same name.
26-
*
27-
* To get the name including the namespace, use `getQualifiedName` or
28-
* `hasQualifiedName`.
29-
*
30-
* To test whether a function has a particular name in the global
31-
* namespace, use `hasGlobalName`.
32-
*/
3320
override string getName() { functions(underlyingElement(this),result,_) }
3421

3522
/**

0 commit comments

Comments
 (0)