Skip to content

[cxx-interop] Make sure we emit lifetime warnings for templated classes #83786

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 18, 2025

Conversation

Xazax-hun
Copy link
Contributor

rdar://155542619

@Xazax-hun Xazax-hun added the c++ interop Feature: Interoperability with C++ label Aug 18, 2025
@Xazax-hun
Copy link
Contributor Author

@swift-ci please smoke test

Copy link
Contributor

@j-hui j-hui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! But I only see changes to test cases. Was this working all along/fixed in a previous commit?

@j-hui
Copy link
Contributor

j-hui commented Aug 18, 2025

Also: it might be too cumbersome for this patch, but I'm wondering whether we should convert this to a -verify test with expected errors instead of check statements.

@Xazax-hun
Copy link
Contributor Author

Was this working all along/fixed in a previous commit?

It was always working, I think the example in the rdar is incomplete (some lifetimebound annotations missing). That was the reason why the warnings were not triggered there. But I figured we could add some tests to make sure this is covered.

@Xazax-hun Xazax-hun enabled auto-merge August 18, 2025 15:18
@Xazax-hun
Copy link
Contributor Author

wondering whether we should convert this to a -verify test with expected errors instead of check statements.

That would be great. Do you know if we have something akin to prefixes in FileCheck to make it easier to test multiple configs in the same file with -verify?

@Xazax-hun Xazax-hun merged commit 46677a5 into swiftlang:main Aug 18, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ interop Feature: Interoperability with C++
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants