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

AK: Use direct-list-initialization for Vector::empend() #4564

Merged
merged 1 commit into from
Dec 27, 2020

Conversation

lanza
Copy link
Contributor

@lanza lanza commented Dec 27, 2020

clang trunk with -std=c++20 doesn't seem to properly look for an
aggregate initializer here when the type being constructed is a simple
aggregate (e.g. struct Thing { int a; int b; };). This template fails
to compile in a usage added 12/16/2020 in AK/Trie.h.

Both forms of initialization are supposed to call the
aggregate-initializers but direct-list-initialization delegating to
aggregate initializers is a new addition in c++20 that might not be
implemented yet.

The other changes are type narrowing issues brought to light by
switching to brace init. All these usages are templates which resolve
their templated arguments to int given integer literal inputs and
not the proper types for the type they are constructing.

@lanza
Copy link
Contributor Author

lanza commented Dec 27, 2020

Note -- there are still other build blockers on Darwin atm and I haven't been able to finish the build nor run it. But this fixes compilation errors.

…on for empend

clang trunk with -std=c++20 doesn't seem to properly look for an
aggregate initializer here when the type being constructed is a simple
aggregate (e.g. `struct Thing { int a; int b; };`). This template fails
to compile in a usage added 12/16/2020 in `AK/Trie.h`.

Both forms of initialization are supposed to call the
aggregate-initializers but direct-list-initialization delegating to
aggregate initializers is a new addition in c++20 that might not be
implemented yet.
@alimpfard
Copy link
Member

be me
use c++20 feature for extra comfort
macos-build-breaks.jpg

@lanza
Copy link
Contributor Author

lanza commented Dec 27, 2020

This has nothing to do with macOS, this is a clang issue.

@alimpfard
Copy link
Member

Which almost always shows up as the macOS build breaking, as clang is the default there :P

@awesomekling awesomekling changed the title Vector: Use direct-list-initialization instead of direct-initialization for empend AK: Use direct-list-initialization for Vector::empend() Dec 27, 2020
@awesomekling awesomekling merged commit d1891f6 into SerenityOS:master Dec 27, 2020
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.

None yet

3 participants