@@ -124,6 +124,7 @@ private predicate constructorCallTypeMention(ConstructorCall cc, TypeMention tm)
124124
125125/**
126126 * Gets an element, of kind `kind`, that element `e` uses, if any.
127+ * Attention: This predicate yields multiple definitions for a single location.
127128 *
128129 * The `kind` is a string representing what kind of use it is:
129130 * - `"M"` for function and method calls
@@ -196,15 +197,7 @@ Top definitionOf(Top e, string kind) {
196197 not e .( Element ) .isInMacroExpansion ( ) and
197198 // exclude nested macro invocations, as they will overlap with
198199 // the top macro invocation.
199- not exists ( e .( MacroAccess ) .getParentInvocation ( ) ) and
200- // exclude results from template instantiations, as:
201- // (1) these dependencies will often be caused by a choice of
202- // template parameter, which is non-local to this part of code; and
203- // (2) overlapping results pointing to different locations will
204- // be very common.
205- // It's possible we could allow a subset of these dependencies
206- // in future, if we're careful to ensure the above don't apply.
207- not e .isFromTemplateInstantiation ( _)
200+ not exists ( e .( MacroAccess ) .getParentInvocation ( ) )
208201 ) and
209202 // Some entities have many locations. This can arise for an external
210203 // function that is frequently declared but not defined, or perhaps
0 commit comments