@@ -369,53 +369,4 @@ private class FunctionType extends Type {
369
369
result = this .( RoutineType ) .getParameterType ( i ) or
370
370
result = this .( FunctionPointerIshType ) .getParameterType ( i )
371
371
}
372
- }
373
- /*
374
- * predicate typesCompatibleImpl(Type t1, Type t2) {
375
- * // A type is compatible with itself
376
- * t1 = t2
377
- * or
378
- * // All specifiers must match, but the order does not matter:
379
- * (
380
- * t1 instanceof SpecifiedType and
381
- * t2 instanceof SpecifiedType
382
- * ) and
383
- * specifiersMatchExactly(t1, t2) and
384
- * typesCompatibleImpl(t1.stripTopLevelSpecifiers(), t2.stripTopLevelSpecifiers())
385
- * or
386
- * // Identically qualified pointers are compatible if they point to compatible types.
387
- * typesCompatibleImpl(t1.(PointerType).getBaseType(), t2.(PointerType).getBaseType())
388
- * or
389
- * // Array objects are compatible if they have a compatible element type. If both have a constant
390
- * // size then that size must match.
391
- * typesCompatibleImpl(t1.(ArrayType).getBaseType(), t2.(ArrayType).getBaseType()) and
392
- * count(int i | i = [t1, t2].(ArrayType).getSize()) < 2
393
- * or
394
- * // Enum types are compatible with one of char, int, or signed int, but the implementation
395
- * // decides.
396
- * [t1, t2] instanceof Enum and
397
- * ([t1, t2] instanceof CharType or [t1, t2] instanceof IntType)
398
- * or
399
- * // `int` is the same as `signed`, `signed int`, while `unsigned` is the same as `unsigned int`.
400
- * t1.(IntegralType).getCanonicalArithmeticType() = t2.(IntegralType).getCanonicalArithmeticType()
401
- * or
402
- * // Function types are compatible if they have the same return type and compatible parameters.
403
- * // Technically, variadic functions are have special behavior not covered here.
404
- * exists(RoutineType f1, RoutineType f2 | f1 = t1 and f2 = t2 |
405
- * typesCompatibleImpl(f1.getReturnType(), f2.getReturnType()) and
406
- * forall(int i | exists([f1, f2].getParameterType(i)) |
407
- * typesCompatibleImpl(f1.getParameterType(i), f2.getParameterType(i))
408
- * )
409
- * )
410
- * or
411
- * // Function pointer types should be covered by `PointerType` and `RoutineType` above, but that is
412
- * // not how they are implemented in CodeQL.
413
- * exists(FunctionPointerIshType f1, FunctionPointerIshType f2 | f1 = t1 and f2 = t2 |
414
- * typesCompatibleImpl(f1.getReturnType(), f2.getReturnType()) and
415
- * forall(int i | exists([f1, f2].getParameterType(i)) |
416
- * typesCompatibleImpl(f1.getParameterType(i), f2.getParameterType(i))
417
- * )
418
- * )
419
- * }
420
- */
421
-
372
+ }
0 commit comments