From 9982112b611f041168db8e43d434d7ae8f8e5e36 Mon Sep 17 00:00:00 2001 From: Andrew Eisenberg Date: Tue, 2 Mar 2021 08:57:17 -0800 Subject: [PATCH] Documentation: Update C/C++ Element::fromSource() docs The previous documentation was not correct. This documentation is adapted from File::fromSource(). --- cpp/ql/src/semmle/code/cpp/Element.qll | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/cpp/ql/src/semmle/code/cpp/Element.qll b/cpp/ql/src/semmle/code/cpp/Element.qll index 66f23ea110f..daa15e0f625 100644 --- a/cpp/ql/src/semmle/code/cpp/Element.qll +++ b/cpp/ql/src/semmle/code/cpp/Element.qll @@ -80,11 +80,9 @@ class Element extends ElementBase { File getFile() { result = this.getLocation().getFile() } /** - * Holds if this element may be from source. - * - * Note: this predicate is provided for consistency with the libraries - * for other languages, such as Java and Python. In C++, all files are - * classified as source files, so this predicate is always true. + * Holds if this element may be from source. This predicate holds for all + * elements, except for those in the dummy file, whose name is the empty string. + * The dummy file contains declarations that are built directly into the compiler. */ predicate fromSource() { this.getFile().fromSource() }