From ed6775c58550f84d4393f8ba89ef50be3001d97f Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Fri, 9 Oct 2020 20:17:01 +0300 Subject: [PATCH 1/3] types: adjust validation_visitor construction for clang Clang does not implement P0960R3, parenthesized initialization of aggregates, so we have to use brace initialization in validation_visitor. It also does not implement class template argument deduction for aggregates (P1816r0), so we have to specify the template parameters explicity. --- types.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/types.cc b/types.cc index 1ae01b1670..5f882ff507 100644 --- a/types.cc +++ b/types.cc @@ -1403,6 +1403,7 @@ struct validate_visitor { FragmentRangeView v; cql_serialization_format sf; + void operator()(const reversed_type_impl& t) { return t.underlying_type()->validate(underlying, sf); } void operator()(const abstract_type&) {} template void operator()(const integer_type_impl& t) { @@ -1572,11 +1573,11 @@ struct validate_visitor { } void abstract_type::validate(const fragmented_temporary_buffer::view& view, cql_serialization_format sf) const { - visit(*this, validate_visitor{view, view, sf}); + visit(*this, validate_visitor{view, view, sf}); } void abstract_type::validate(bytes_view v, cql_serialization_format sf) const { - visit(*this, validate_visitor{v, single_fragment_range(v), sf}); + visit(*this, validate_visitor>{v, single_fragment_range(v), sf}); } static void serialize_aux(const tuple_type_impl& type, const tuple_type_impl::native_type* val, bytes::iterator& out) { From 8e386a5f4835afe0465b2f437c59ef8c38c84376 Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Fri, 9 Oct 2020 20:17:01 +0300 Subject: [PATCH 2/3] schema_tables: adjust altered_schema construction for clang Clang does not implement P0960R3, parenthesized initialization of aggregates, so we have to use brace initialization in altered_schema. As the parenthesized constructor call is done by emplace_back(), we have to do the braced call ourselves. --- db/schema_tables.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/schema_tables.cc b/db/schema_tables.cc index 874db811fc..d96d46b562 100644 --- a/db/schema_tables.cc +++ b/db/schema_tables.cc @@ -1182,7 +1182,7 @@ static schema_diff diff_table_or_view(distributed& proxy auto s_before = create_schema(std::move(before.at(key))); auto s = create_schema(std::move(after.at(key))); slogger.info("Altering {}.{} id={} version={}", s->ks_name(), s->cf_name(), s->id(), s->version()); - d.altered.emplace_back(s_before, s); + d.altered.emplace_back(schema_diff::altered_schema{s_before, s}); } return d; } From cfada6e04dd4a4b692f34f92a1eb70a3e6f026ce Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Fri, 9 Oct 2020 20:17:01 +0300 Subject: [PATCH 3/3] reader_concurrency_semaphore: adjust permit_summary construction for clang Clang does not implement P0960R3, parenthesized initialization of aggregates, so we have to use brace initialization in permit_summary. As the parenthesized constructor call is done by emplace_back(), we have to do the braced call ourselves. --- reader_concurrency_semaphore.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reader_concurrency_semaphore.cc b/reader_concurrency_semaphore.cc index ac6d316c35..9b2024022e 100644 --- a/reader_concurrency_semaphore.cc +++ b/reader_concurrency_semaphore.cc @@ -261,7 +261,7 @@ static permit_stats do_dump_reader_permit_diagnostics(std::ostream& os, const pe for (const auto& [k, v] : permits) { const auto& [s, op_name, k_state] = k; if (k_state == state) { - permit_summaries.emplace_back(s, op_name, v.memory, v.count); + permit_summaries.emplace_back(permit_summary{s, op_name, v.memory, v.count}); } }