File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed
cpp/ql/src/semmle/code/cpp/exprs Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -453,12 +453,19 @@ class Expr extends StmtParent, @expr {
453453 * cast from B to C. Only (1) and (2) would be included.
454454 */
455455 Expr getExplicitlyConverted ( ) {
456- // result is this or one of its conversions
457- result = this .getConversion * ( ) and
458- // result is not an implicit conversion - it's either the expr or an explicit cast
459- ( result = this or not result .( Cast ) .isImplicit ( ) ) and
460- // there is no further explicit conversion after result
461- not exists ( Cast other | other = result .getConversion + ( ) and not other .isImplicit ( ) )
456+ if this .hasConversion ( )
457+ then
458+ if this .hasExplicitConversion ( )
459+ then
460+ result = this .getConversion ( ) .getExplicitlyConverted ( )
461+ else
462+ if this .getImplicitlyConverted ( ) .hasExplicitConversion ( )
463+ then
464+ result = this .getImplicitlyConverted ( ) .getConversion ( ) .getExplicitlyConverted ( )
465+ else
466+ result = this
467+ else
468+ result = this
462469 }
463470
464471 /**
You can’t perform that action at this time.
0 commit comments