Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 37d9bd9

Browse filesBrowse files
committed
Merge branch 'knewbury01/fix-118' of https://github.com/knewbury01/codeql-coding-standards into knewbury01/fix-118
2 parents 5606a6c + 3d2e413 commit 37d9bd9
Copy full SHA for 37d9bd9

File tree

Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed

‎cpp/common/src/codingstandards/cpp/Scope.qll

Copy file name to clipboardExpand all lines: cpp/common/src/codingstandards/cpp/Scope.qll
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class UserDeclaration extends Declaration {
6767
not this.(Variable).isCompilerGenerated() and
6868
not this.(Function).isCompilerGenerated() and
6969
not this.(Parameter).getFunction().isCompilerGenerated() and
70-
// will falsely conflict
70+
// Class template instantiations are compiler generated instances that share the same parent scope. This will result in a cross-product on class template instantiations because they have the same name and same parent scope. We therefore exclude these from consideration like we do with other compiler generated identifiers of interest.
7171
not this instanceof ClassTemplateInstantiation and
7272
// compiler inferred parameters have name of p#0
7373
not this.(Parameter).getName() = "p#0"
@@ -274,7 +274,7 @@ predicate hides(UserDeclaration v1, UserDeclaration v2) {
274274
hides_candidate(v1, mid) and
275275
hides_candidate(mid, v2)
276276
) and
277-
//ignore intentional overloads
277+
// Unlike `hidesStrict`, that requires a different scope, `hides` considers declarations in the same scope. This will include function overloads based on their name. To remove overloads from consideration, we exclude them.
278278
not v1.(Function).getAnOverload() = v2
279279
}
280280

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.