Skip to content

Commit dc51272

Browse files
committed
C++: Make File extend Locatable
1 parent 4ea5c13 commit dc51272

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,10 @@ class Folder extends Container, Impl::Folder {
6262
* The base name further decomposes into the _stem_ and _extension_ -- see
6363
* `getStem` and `getExtension`. To get the full path, use `getAbsolutePath`.
6464
*/
65-
class File extends Container, Impl::File {
65+
class File extends Container, Locatable, Impl::File {
6666
override string getAPrimaryQlClass() { result = "File" }
6767

68-
/** Gets the primary location of this file. */
69-
Location getLocation() {
68+
override Location getLocation() {
7069
result.getContainer() = this and
7170
result.hasLocationInfo(_, 0, 0, 0, 0)
7271
}
@@ -124,7 +123,7 @@ class File extends Container, Impl::File {
124123
* except the dummy file, whose name is the empty string, which contains
125124
* declarations that are built into the compiler.
126125
*/
127-
predicate fromSource() { numlines(underlyingElement(this), _, _, _) }
126+
override predicate fromSource() { numlines(underlyingElement(this), _, _, _) }
128127

129128
/** Gets the metric file. */
130129
MetricFile getMetrics() { result = this }

0 commit comments

Comments
 (0)