C++ Interop: Add a test that demonstrates that const non nullable pointers are wrongly mapped to nullable (optional) pointers (#6284)

Part of #5772.
This commit is contained in:
Boaz Brickner
2025-10-29 09:12:25 +00:00
committed by GitHub
parent 4d4d720ff0
commit fc8db6ac5c
2 changed files with 129 additions and 5 deletions
+3
View File
@@ -1459,6 +1459,9 @@ static auto MakeParamPatternsBlockId(Context& context, SemIR::LocId loc_id,
// The parameter type is decayed but hasn't necessarily had its qualifiers
// removed.
// TODO: The presence of qualifiers here is probably a Clang bug.
// TODO: For const non nullable pointers (`C* _Nonnull const`), this removes
// both the const and the non-nullable attribute. We should probably
// preserve the non-nullable attribute.
clang::QualType param_type = orig_param_type.getUnqualifiedType();
// Mark the start of a region of insts, needed for the type expression