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

Bug 559318 - construct via initialisation list with single item #448

Closed
wants to merge 1 commit into from

Conversation

davmac314
Copy link
Contributor

Add the special case handling from [dcl.list.init] so that a class object can be constructed using an initialisation list with a single item of the same type (or subclass type).

This is not a complete fix for all cases of initialisation lists (in particular string literals aren't handled) but it should help for the case identified in the bug.

@davmac314
Copy link
Contributor Author

The test failures don't seem to have anything to do with the change, which is relatively small :(

@jonahgraham jonahgraham added the language C/C++ Language Support label Jul 19, 2023
@jonahgraham
Copy link
Member

Sorry that no one has been able to review this yet. The language part of CDT is outside my depth of knowledge normally, but if no one else is able to review this soon I will try to find time to review it myself.

There has recently been a regression in test results which appears to be caused by updating dependencies or something else external. See #454

@davmac314
Copy link
Contributor Author

Thanks @jonahgraham . I have a number of other fixes lined up as well, but I will hold off on creating PRs for those until these have gone through, to keep it easier to manage (also for myself).

@davmac314
Copy link
Contributor Author

Hi @jonahgraham - I have rebased on current main. There is still a test failure, but it still looks unrelated to my changes (though different from last time).

Add the special case handling from [dcl.list.init] so that a class
object can be constructed using an initialisation list with a single
item of the same type (or subclass type).

This is not a complete fix for all cases of initialisation lists (in
particular string literals aren't handled) but it should help for the
case identified in the bug.
@i-garrison
Copy link
Contributor

i-garrison commented Sep 26, 2023

...

@i-garrison
Copy link
Contributor

I now added a PR which fixes this particular issue with single list item of same class type, and also handles other places where list-initialization sequence needs more careful processing. Please compare #581 - there are few more tests added too.

@davmac314
Copy link
Contributor Author

I'm happy for this PR to be closed in preference to #581

@davmac314
Copy link
Contributor Author

Closing this in favour of #581

@davmac314 davmac314 closed this Nov 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
language C/C++ Language Support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants