[clang] [Clang] Introduce OverflowBehaviorType for fine-grained overflow control (PR #148914)
Matheus Izvekov via cfe-commits
cfe-commits at lists.llvm.org
Fri Aug 22 19:56:22 PDT 2025
================
@@ -14308,6 +14455,12 @@ static QualType getCommonNonSugarTypeNode(const ASTContext &Ctx, const Type *X,
getCommonTypeKeyword(NX, NY, /*IsSame=*/true),
getCommonQualifier(Ctx, NX, NY, /*IsSame=*/true), NX->getIdentifier());
}
+ case Type::OverflowBehavior: {
+ // FIXME: Should we consider both types?
+ const auto *NX = cast<OverflowBehaviorType>(X);
+ return Ctx.getOverflowBehaviorType(NX->getBehaviorKind(),
+ NX->getUnderlyingType());
----------------
mizvekov wrote:
Yes :)
```suggestion
const auto *NX = cast<OverflowBehaviorType>(X), *NY = cast<OverflowBehaviorType>(Y);
assert(NX->getBehaviorKind() = NY->getBehaviorKind());
return Ctx.getOverflowBehaviorType(NX->getBehaviorKind(), ::getCommonUnderlyingType(NX, NY));
```
https://github.com/llvm/llvm-project/pull/148914
More information about the cfe-commits
mailing list