Skip to content

Use initializer list instead of copy constructor in ExtraInhabitantsValueWitnessTable constructor #7764

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
Feb 26, 2017
Merged

Use initializer list instead of copy constructor in ExtraInhabitantsValueWitnessTable constructor #7764

merged 1 commit into from
Feb 26, 2017

Conversation

hughbe
Copy link
Contributor

@hughbe hughbe commented Feb 25, 2017

Metadata.h is included by IRGen code, so has to compile with MSVC.

Previously, an MSVC bug/perhaps lack of c++ 14 conformance meant that this code wouldn't compile. According to cppreference "every constructor selected to initializing non-static members and base class must be a constexpr constructor"

https://connect.microsoft.com/VisualStudio/feedback/details/3122313/msvc-cant-compile-constexpr-constructor-initializing-non-static-members-and-base-class

The fix is to use initializer lists to initialize the base class, rather than a copy constructor. This does the same thing.

@hughbe
Copy link
Contributor Author

hughbe commented Feb 25, 2017

@gparker42

@hughbe
Copy link
Contributor Author

hughbe commented Feb 25, 2017

@swift-ci please smoke test

@hughbe hughbe merged commit e14b948 into swiftlang:master Feb 26, 2017
@hughbe hughbe deleted the extra-value-witnesstable-constexpr branch February 26, 2017 04:06
@hughbe
Copy link
Contributor Author

hughbe commented Feb 26, 2017

Crumbs accidental merge... let me know if you have any issues and I can revert

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant