1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:18:11 +00:00

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

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.
This commit is contained in:
Nathan Lanza 2020-12-27 17:06:37 -05:00 committed by GitHub
parent 1867c928a9
commit d1891f67ac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 6 deletions

View file

@ -191,7 +191,7 @@ public:
ByteCode bytecode;
bytecode.empend(static_cast<ByteCodeValueType>(OpCodeId::Compare));
bytecode.empend(1); // number of arguments
bytecode.empend(static_cast<u64>(1)); // number of arguments
ByteCode arguments;
@ -209,7 +209,7 @@ public:
ByteCode bytecode;
bytecode.empend(static_cast<ByteCodeValueType>(OpCodeId::Compare));
bytecode.empend(1); // number of arguments
bytecode.empend(static_cast<u64>(1)); // number of arguments
ByteCode arguments;