Skip to content

Commit 9982112

Browse files
committed
Documentation: Update C/C++ Element::fromSource() docs
The previous documentation was not correct. This documentation is adapted from File::fromSource().
1 parent 648910e commit 9982112

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,9 @@ class Element extends ElementBase {
8080
File getFile() { result = this.getLocation().getFile() }
8181

8282
/**
83-
* Holds if this element may be from source.
84-
*
85-
* Note: this predicate is provided for consistency with the libraries
86-
* for other languages, such as Java and Python. In C++, all files are
87-
* classified as source files, so this predicate is always true.
83+
* Holds if this element may be from source. This predicate holds for all
84+
* elements, except for those in the dummy file, whose name is the empty string.
85+
* The dummy file contains declarations that are built directly into the compiler.
8886
*/
8987
predicate fromSource() { this.getFile().fromSource() }
9088

0 commit comments

Comments
 (0)