================
@@ -7519,6 +7519,26 @@ static bool
HandleWebAssemblyFuncrefAttr(TypeProcessingState &State,
return false;
}
+/// Rebuild an attributed type without the nullability attribute on it.
+static QualType rebuildAttributedTypeWithoutNullability(ASTContext &Ctx,
+ QualType Type) {
+ auto Attributed = dyn_cast<AttributedType>(Type.getTypePtr());
+ if (!Attributed)
+ return Type;
+
+ // Skip the nullability attribute; we're done.
+ if (Attributed->getImmediateNullability()) {
+ return Attributed->getModifiedType();
+ }
+
+ // Build the modified type.
+ auto Modified = rebuildAttributedTypeWithoutNullability(
----------------
compnerd wrote:
I assume that this is an `AttributedType`? I don't think its necessarily clear
what the type of the expression is, so it might be worth spelling it out.
https://github.com/llvm/llvm-project/pull/73017
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits