Skip to content

Commit

Permalink
Everywhere: Work around Clang trunk bug with templated lambda + Variant
Browse files Browse the repository at this point in the history
Since 2023-09-08, Clang trunk has had a bug which causes a segfault when
evaluating certain `requires` expressions inside templated lambdas.
There isn't an imminent fix on the horizon, so let's work around the
issue by specifying the type of the offending lambda arguments
explicitly.

See llvm/llvm-project#67260
  • Loading branch information
BertalanD authored and ADKaster committed Nov 5, 2023
1 parent 6c29fc0 commit 6f972c1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ ThrowCompletionOr<NonnullGCPtr<DateTimeFormat>> create_date_time_format(VM& vm,
PropertyKey const* explicit_format_component = nullptr;

// 39. For each row of Table 6, except the header row, in table order, do
TRY(for_each_calendar_field(vm, format_options, [&](auto& option, auto const& property, auto const& values) -> ThrowCompletionOr<void> {
TRY(for_each_calendar_field(vm, format_options, [&](auto& option, PropertyKey const& property, auto const& values) -> ThrowCompletionOr<void> {
using ValueType = typename RemoveReference<decltype(option)>::ValueType;

// a. Let prop be the name given in the Property column of the row.
Expand Down
2 changes: 1 addition & 1 deletion Userland/Libraries/LibWeb/WebDriver/Capabilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ static ErrorOr<JsonObject, Error> validate_capabilities(JsonValue const& capabil
JsonObject result;

// 3. For each enumerable own property in capability, run the following substeps:
TRY(capability.as_object().try_for_each_member([&](auto const& name, auto const& value) -> ErrorOr<void, Error> {
TRY(capability.as_object().try_for_each_member([&](auto const& name, JsonValue const& value) -> ErrorOr<void, Error> {
// a. Let name be the name of the property.
// b. Let value be the result of getting a property named name from capability.

Expand Down
2 changes: 1 addition & 1 deletion Userland/Services/RequestServer/ConnectionCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ ErrorOr<void> recreate_socket_if_needed(T& connection, URL const& url)

if (!connection.socket->is_open() || connection.socket->is_eof()) {
// Create another socket for the connection.
auto set_socket = [&](auto socket) -> ErrorOr<void> {
auto set_socket = [&](NonnullOwnPtr<SocketStorageType>&& socket) -> ErrorOr<void> {
connection.socket = TRY(Core::BufferedSocket<SocketStorageType>::create(move(socket)));
return {};
};
Expand Down

0 comments on commit 6f972c1

Please sign in to comment.