Skip to content

Commit 990d716

Browse files
authored
Merge pull request github#14337 from aschackmull/cpp/container-not-locatable
C++: Remove getLocation from Container.
2 parents 53d92d5 + 75a1173 commit 990d716

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
category: breaking
3+
---
4+
* The `Container` and `Folder` classes now derive from `ElementBase` instead of `Locatable`, and no longer expose the `getLocation` predicate. Use `getURL` instead.

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

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ private module Input implements InputSig {
3232
private module Impl = Make<Input>;
3333

3434
/** A file or folder. */
35-
class Container extends Locatable, Impl::Container {
35+
class Container extends ElementBase, Impl::Container {
3636
override string toString() { result = Impl::Container.super.toString() }
3737
}
3838

@@ -47,11 +47,6 @@ class Container extends Locatable, Impl::Container {
4747
* To get the full path, use `getAbsolutePath`.
4848
*/
4949
class Folder extends Container, Impl::Folder {
50-
override Location getLocation() {
51-
result.getContainer() = this and
52-
result.hasLocationInfo(_, 0, 0, 0, 0)
53-
}
54-
5550
override string getAPrimaryQlClass() { result = "Folder" }
5651
}
5752

@@ -67,7 +62,7 @@ class Folder extends Container, Impl::Folder {
6762
* The base name further decomposes into the _stem_ and _extension_ -- see
6863
* `getStem` and `getExtension`. To get the full path, use `getAbsolutePath`.
6964
*/
70-
class File extends Container, Impl::File {
65+
class File extends Container, Locatable, Impl::File {
7166
override string getAPrimaryQlClass() { result = "File" }
7267

7368
override Location getLocation() {

0 commit comments

Comments
 (0)