Skip to content
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

[SR-14205] [C++] Don't crash when importing recursive class template with non-type template parameter. #56583

Closed
zoecarver opened this issue Feb 13, 2021 · 1 comment
Labels
c++ interop Feature: Interoperability with C++ compiler The Swift compiler in itself good first issue Good for newcomers improvement

Comments

@zoecarver
Copy link
Collaborator

Previous ID SR-14205
Radar None
Original Reporter @zoecarver
Type Improvement
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Improvement, CxxInterop, StarterBug
Assignee thomassw66 (JIRA)
Priority Medium

md5: fcfd63523788866b3c814d102620414f

Issue Description:

Currently, we crash here when clang can't find the member specialization info. This is just a matter of finding what condition we need to bail on so it might be a good beginner issue.

template<int value>
struct RecurssiveTemplateWithValue {
  static const int next = RecurssiveTemplateWithValue<value - 1>::next;
};

template<>
struct RecurssiveTemplateWithValue<0> {
  static const int next = 0;
};

using WillBeZero = RecurssiveTemplateWithValue<100>;
@zoecarver
Copy link
Collaborator Author

One of my patches must have fixed this. The snippet no longer crashes on main.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@zoecarver zoecarver added c++ interop Feature: Interoperability with C++ and removed CxxInterop labels Apr 25, 2022
This issue was closed.
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++ compiler The Swift compiler in itself good first issue Good for newcomers improvement
Projects
None yet
Development

No branches or pull requests

1 participant