From aa7426bde6f8f76d57dfd1b43fb087b3a3a24d18 Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Mon, 21 Sep 2020 14:53:00 +0300 Subject: [PATCH] sstables: index_reader: make 'index_bound' public index_reader::index_bound must be constructible by non-friend classes since it's used in std::optional (which isn't anyone's friend). This now works in gcc because gcc's inter-template access checking is broken, but clang correctly rejects it. --- sstables/index_reader.hh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sstables/index_reader.hh b/sstables/index_reader.hh index 31e2ba2a05..aac8fb3d08 100644 --- a/sstables/index_reader.hh +++ b/sstables/index_reader.hh @@ -390,6 +390,10 @@ class index_reader { tombstone tomb; }; +public: // Otherwise std::optional::emplace() fails, since + // it has a constraint std::is_constructible_v, which fails with + // private types + // Contains information about index_reader position in the index file struct index_bound { shared_index_lists::list_ptr current_list; @@ -402,6 +406,7 @@ class index_reader { std::optional end_open_marker; }; +private: index_bound _lower_bound; // Upper bound may remain uninitialized std::optional _upper_bound;