File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
cpp/common/src/codingstandards/cpp Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -352,7 +352,15 @@ class RAIIStyleLock extends LockingOperation {
352352 getTarget ( ) .getDeclaringType ( ) .hasQualifiedName ( "std" , "unique_lock" ) or
353353 getTarget ( ) .getDeclaringType ( ) .hasQualifiedName ( "std" , "scoped_lock" )
354354 ) and
355- lock = getArgument ( 0 ) .getAChild * ( )
355+ (
356+ lock = getArgument ( 0 ) .getAChild * ( )
357+ or
358+ this instanceof DestructorCall and
359+ exists ( RAIIStyleLock constructor |
360+ constructor = getQualifier ( ) .( VariableAccess ) .getTarget ( ) .getInitializer ( ) .getExpr ( ) and
361+ lock = constructor .getArgument ( 0 ) .getAChild * ( )
362+ )
363+ )
356364 }
357365
358366 /**
@@ -361,6 +369,7 @@ class RAIIStyleLock extends LockingOperation {
361369 override predicate isLock ( ) {
362370 not isLockingOperationWithinLockingOperation ( this ) and
363371 this instanceof ConstructorCall and
372+ lock = getArgument ( 0 ) .getAChild * ( ) and
364373 // defer_locks don't cause a lock
365374 not exists ( Expr exp |
366375 exp = getArgument ( 1 ) and
You can’t perform that action at this time.
0 commit comments