| 1258 | |
| 1259 | template<typename QT, typename SUB_T, typename SUB_T2 = void> |
| 1260 | static bool HasTypeWithSubType(const QualType& t) |
| 1261 | { |
| 1262 | if(const auto* lref = dyn_cast_or_null<QT>(t.getTypePtrOrNull())) { |
| 1263 | const auto subType = GetDesugarType(lref->getPointeeType()); |
| 1264 | const auto& ct = subType.getCanonicalType(); |
| 1265 | const auto* plainSubType = ct.getTypePtrOrNull(); |
| 1266 | |
| 1267 | if(const auto* st = dyn_cast_or_null<SUB_T>(plainSubType)) { |
| 1268 | if constexpr(std::is_same_v<void, SUB_T2>) { |
| 1269 | return true; |
| 1270 | |
| 1271 | } else { |
| 1272 | const auto subType = GetDesugarType(st->getPointeeType()); |
| 1273 | const auto& ct = subType.getCanonicalType(); |
| 1274 | const auto* plainSubType = ct.getTypePtrOrNull(); |
| 1275 | |
| 1276 | return isa<SUB_T2>(plainSubType); |
| 1277 | } |
| 1278 | } |
| 1279 | } |
| 1280 | |
| 1281 | return false; |
| 1282 | } |
| 1283 | //----------------------------------------------------------------------------- |
| 1284 | |
| 1285 | template<typename QT, typename SUB_T> |
nothing calls this directly
no test coverage detected