mirror of
https://github.com/github/codeql.git
synced 2026-04-27 09:45:15 +02:00
Merge pull request #18588 from jketema/decl-entry
C++: Fix join-order problem in `UserType::getADeclarationEntry`
This commit is contained in:
@@ -47,10 +47,16 @@ class UserType extends Type, Declaration, NameQualifyingElement, AccessHolder, @
|
|||||||
else result = this.getADeclarationLocation()
|
else result = this.getADeclarationLocation()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pragma[nomagic]
|
||||||
|
private TypeDeclarationEntry getADeclarationEntryBase() {
|
||||||
|
type_decls(underlyingElement(result), unresolveElement(this), _)
|
||||||
|
}
|
||||||
|
|
||||||
override TypeDeclarationEntry getADeclarationEntry() {
|
override TypeDeclarationEntry getADeclarationEntry() {
|
||||||
if type_decls(_, unresolveElement(this), _)
|
pragma[only_bind_into](result) = pragma[only_bind_into](this).getADeclarationEntryBase()
|
||||||
then type_decls(underlyingElement(result), unresolveElement(this), _)
|
or
|
||||||
else exists(Class t | this.(Class).isConstructedFrom(t) and result = t.getADeclarationEntry())
|
not exists(this.getADeclarationEntryBase()) and
|
||||||
|
exists(Class t | this.(Class).isConstructedFrom(t) and result = t.getADeclarationEntry())
|
||||||
}
|
}
|
||||||
|
|
||||||
override Location getADeclarationLocation() { result = this.getADeclarationEntry().getLocation() }
|
override Location getADeclarationLocation() { result = this.getADeclarationEntry().getLocation() }
|
||||||
|
|||||||
Reference in New Issue
Block a user