@@ -129,7 +129,7 @@ class Element extends ElementBase {
129129 * or certain kinds of `Statement`.
130130 */
131131 Element getParentScope ( ) {
132- // result instanceof class
132+ // result instanceof Class
133133 exists ( Declaration m |
134134 m = this and
135135 result = m .getDeclaringType ( ) and
@@ -138,31 +138,40 @@ class Element extends ElementBase {
138138 or
139139 exists ( TemplateClass tc | this = tc .getATemplateArgument ( ) and result = tc )
140140 or
141- // result instanceof namespace
141+ // result instanceof Namespace
142142 exists ( Namespace n | result = n and n .getADeclaration ( ) = this )
143143 or
144144 exists ( FriendDecl d , Namespace n | this = d and n .getADeclaration ( ) = d and result = n )
145145 or
146146 exists ( Namespace n | this = n and result = n .getParentNamespace ( ) )
147147 or
148- // result instanceof stmt
148+ // result instanceof Stmt
149149 exists ( LocalVariable v |
150150 this = v and
151151 exists ( DeclStmt ds | ds .getADeclaration ( ) = v and result = ds .getParent ( ) )
152152 )
153153 or
154- exists ( Parameter p | this = p and result = p .getFunction ( ) )
154+ exists ( Parameter p |
155+ this = p and
156+ (
157+ result = p .getFunction ( ) or
158+ result = p .getCatchBlock ( ) .getParent ( ) .( Handler ) .getParent ( ) .( TryStmt ) .getParent ( ) or
159+ result = p .getRequiresExpr ( ) .getEnclosingStmt ( ) .getParent ( )
160+ )
161+ )
155162 or
156163 exists ( GlobalVariable g , Namespace n | this = g and n .getADeclaration ( ) = g and result = n )
157164 or
165+ exists ( TemplateVariable tv | this = tv .getATemplateArgument ( ) and result = tv )
166+ or
158167 exists ( EnumConstant e | this = e and result = e .getDeclaringEnum ( ) )
159168 or
160- // result instanceof block|function
169+ // result instanceof Block|Function
161170 exists ( BlockStmt b | this = b and blockscope ( unresolveElement ( b ) , unresolveElement ( result ) ) )
162171 or
163172 exists ( TemplateFunction tf | this = tf .getATemplateArgument ( ) and result = tf )
164173 or
165- // result instanceof stmt
174+ // result instanceof Stmt
166175 exists ( ControlStructure s | this = s and result = s .getParent ( ) )
167176 or
168177 using_container ( unresolveElement ( result ) , underlyingElement ( this ) )
0 commit comments