mirror of
https://github.com/github/codeql.git
synced 2026-04-20 06:24:03 +02:00
C++: Add support for getting referenced literals in using declarations
This commit is contained in:
@@ -174,7 +174,27 @@ class UsingDeclarationEntry extends UsingEntry {
|
||||
*/
|
||||
Declaration getDeclaration() { usings(underlyingElement(this), unresolveElement(result), _, _) }
|
||||
|
||||
override string toString() { result = "using " + this.getDeclaration().getDescription() }
|
||||
/**
|
||||
* Gets the member that is referenced by this using declaration, where the member depends on a
|
||||
* type template parameter.
|
||||
*
|
||||
* For example:
|
||||
* ```
|
||||
* template <typename T>
|
||||
* class A {
|
||||
* using T::m;
|
||||
* };
|
||||
* ```
|
||||
* Here, `getReferencedMember()` yields the member `m` of `T`. Observe that,
|
||||
* as `T` is not instantiated, `m` is represented by a `Literal` and not
|
||||
* a `Declaration`.
|
||||
*/
|
||||
Literal getReferencedMember() { usings(underlyingElement(this), unresolveElement(result), _, _) }
|
||||
|
||||
override string toString() {
|
||||
result = "using " + this.getDeclaration().getDescription() or
|
||||
result = "using " + this.getReferencedMember()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user