================
@@ -1001,11 +994,35 @@ UnwindTagContext(TagDecl *DC, api_notes::APINotesManager
&APINotes) {
return std::nullopt;
}
-static void stripAPINotesParameterNullability(QualType &ParamType) {
- while (true) {
- if (!AttributedType::stripOuterNullability(ParamType))
- return;
+static QualType stripAPINotesParameterNullability(QualType ParamType,
+ const ASTContext &Context) {
+ while (AttributedType::stripOuterNullability(ParamType)) {
+ }
+
+ SplitQualType Split = ParamType.split();
+ QualType Unqualified(Split.Ty, 0);
+ QualType Result = Unqualified;
+
+ if (const auto *PT = llvm::dyn_cast<PointerType>(Unqualified.getTypePtr())) {
----------------
Xazax-hun wrote:
I think it might be easy to miss some cases, e.g., if the nullability qualifier
is in an array type, or a function pointer type. I wonder if this could be
written with a `TypeVisitor` that would be guaranteed to visit every component
of a type.
https://github.com/llvm/llvm-project/pull/215266
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits