mirror of
https://github.com/github/codeql.git
synced 2026-04-27 01:35:13 +02:00
Merge pull request #5922 from AlexDenisov/ref-qualifiers
C++: Add ref qualifiers
This commit is contained in:
2
cpp/change-notes/2021-05-20-ref-qualifiers.md
Normal file
2
cpp/change-notes/2021-05-20-ref-qualifiers.md
Normal file
@@ -0,0 +1,2 @@
|
||||
lgtm,codescanning
|
||||
* lvalue/rvalue ref qualifiers are now accessible via the new predicates on `MemberFunction`(`.isLValueRefQualified`, `.isRValueRefQualified`, and `isRefQualified`).
|
||||
@@ -48,6 +48,15 @@ class MemberFunction extends Function {
|
||||
/** Holds if this member is public. */
|
||||
predicate isPublic() { this.hasSpecifier("public") }
|
||||
|
||||
/** Holds if this declaration has the lvalue ref-qualifier */
|
||||
predicate isLValueRefQualified() { hasSpecifier("&") }
|
||||
|
||||
/** Holds if this declaration has the rvalue ref-qualifier */
|
||||
predicate isRValueRefQualified() { hasSpecifier("&&") }
|
||||
|
||||
/** Holds if this declaration has a ref-qualifier */
|
||||
predicate isRefQualified() { isLValueRefQualified() or isRValueRefQualified() }
|
||||
|
||||
/** Holds if this function overrides that function. */
|
||||
predicate overrides(MemberFunction that) {
|
||||
overrides(underlyingElement(this), unresolveElement(that))
|
||||
|
||||
@@ -26,6 +26,8 @@
|
||||
| clang_ms.cpp:17:1:17:32 | #pragma |
|
||||
| clang_ms.cpp:18:1:18:31 | #pragma |
|
||||
| file://:0:0:0:0 | |
|
||||
| file://:0:0:0:0 | & |
|
||||
| file://:0:0:0:0 | && |
|
||||
| file://:0:0:0:0 | (global namespace) |
|
||||
| file://:0:0:0:0 | (unnamed parameter 0) |
|
||||
| file://:0:0:0:0 | (unnamed parameter 0) |
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
| file://:0:0:0:0 | |
|
||||
| file://:0:0:0:0 | & |
|
||||
| file://:0:0:0:0 | && |
|
||||
| file://:0:0:0:0 | (global namespace) |
|
||||
| file://:0:0:0:0 | (unnamed parameter 0) |
|
||||
| file://:0:0:0:0 | (unnamed parameter 0) |
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
| file://:0:0:0:0 | |
|
||||
| file://:0:0:0:0 | & |
|
||||
| file://:0:0:0:0 | && |
|
||||
| file://:0:0:0:0 | (composite<int> *)... |
|
||||
| file://:0:0:0:0 | (composite<int> *)... |
|
||||
| file://:0:0:0:0 | (global namespace) |
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
| file://:0:0:0:0 | | Other |
|
||||
| file://:0:0:0:0 | & | Other |
|
||||
| file://:0:0:0:0 | && | Other |
|
||||
| file://:0:0:0:0 | (global namespace) | Other |
|
||||
| file://:0:0:0:0 | (unnamed global/namespace variable) | Other |
|
||||
| file://:0:0:0:0 | _Complex __float128 | Other |
|
||||
|
||||
Reference in New Issue
Block a user