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

Fix compile error on Mac Clang 12.0.5 (#2058) #2070

Merged
merged 1 commit into from
Jun 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions dbms/src/Common/UInt128.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,16 +193,25 @@ template <> struct is_signed<DB::UInt128>
static constexpr bool value = false;
};

template <>
inline constexpr bool is_signed_v<DB::UInt128> = is_signed<DB::UInt128>::value;

template <> struct is_unsigned<DB::UInt128>
{
static constexpr bool value = true;
};

template <>
inline constexpr bool is_unsigned_v<DB::UInt128> = is_unsigned<DB::UInt128>::value;

template <> struct is_integral<DB::UInt128>
{
static constexpr bool value = true;
};

template <>
inline constexpr bool is_integral_v<DB::UInt128> = is_integral<DB::UInt128>::value;

// Operator +, -, /, *, % aren't implemented so it's not an arithmetic type
template <> struct is_arithmetic<DB::UInt128>
{
Expand Down
4 changes: 4 additions & 0 deletions dbms/src/Core/Types.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ struct numeric_limits<__int128_t>

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#if defined(__clang__)
#pragma GCC diagnostic ignored "-Wunknown-warning-option"
#pragma GCC diagnostic ignored "-Wdeprecated-copy"
#endif
#include <boost/multiprecision/cpp_int.hpp>
#pragma GCC diagnostic pop

Expand Down
12 changes: 10 additions & 2 deletions dbms/src/DataStreams/PKColumnIterator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ struct PKColumnIterator : public std::iterator<std::random_access_iterator_tag,

PKColumnIterator & operator=(const PKColumnIterator & itr)
{
pos = itr.pos;
column = itr.column;
copy(itr);
return *this;
}

Expand All @@ -25,10 +24,19 @@ struct PKColumnIterator : public std::iterator<std::random_access_iterator_tag,

PKColumnIterator(const int pos_, const IColumn * column_) : pos(pos_), column(column_) {}

PKColumnIterator(const PKColumnIterator & itr) { copy(itr); }

void operator+=(size_t n) { pos += n; }

size_t pos;
const IColumn * column;

private:
inline void copy(const PKColumnIterator & itr)
{
pos = itr.pos;
column = itr.column;
}
};

template<typename HandleType>
Expand Down
4 changes: 4 additions & 0 deletions dbms/src/Functions/GeoUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
#endif

#pragma GCC diagnostic ignored "-Wunused-parameter"
#if defined(__clang__)
#pragma GCC diagnostic ignored "-Wunknown-warning-option"
#pragma GCC diagnostic ignored "-Wdeprecated-copy"
#endif

#include <boost/geometry.hpp>

Expand Down
2 changes: 1 addition & 1 deletion dbms/src/Storages/DeltaMerge/DeltaMergeStore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1815,7 +1815,7 @@ void DeltaMergeStore::applyAlters(const AlterCommands & commands,
original_table_columns.swap(new_original_table_columns);
store_columns.swap(new_store_columns);

std::atomic_store<Block>(&original_table_header, std::make_shared<Block>(toEmptyBlock(original_table_columns)));
std::atomic_store(&original_table_header, std::make_shared<Block>(toEmptyBlock(original_table_columns)));
}


Expand Down
7 changes: 7 additions & 0 deletions dbms/src/Storages/MergeTree/MergeTreeData.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,17 @@
#include <DataStreams/GraphiteRollupSortedBlockInputStream.h>
#include <Storages/MergeTree/MergeTreeDataPart.h>

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#if defined(__clang__)
#pragma GCC diagnostic ignored "-Wunknown-warning-option"
#pragma GCC diagnostic ignored "-Wdeprecated-copy"
#endif
#include <boost/multi_index_container.hpp>
#include <boost/multi_index/ordered_index.hpp>
#include <boost/multi_index/global_fun.hpp>
#include <boost/range/iterator_range_core.hpp>
#pragma GCC diagnostic pop

namespace TiDB
{
Expand Down
2 changes: 2 additions & 0 deletions dbms/src/Storages/Page/PageUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ void writeFile(WritableFilePtr & file, UInt64 offset, char * data, size_t to_wri
res = file->pwrite(data + bytes_written, to_write - bytes_written, offset + bytes_written);
}

#ifndef NDEBUG
// Can inject failpoint under debug mode
fiu_do_on(FailPoints::force_set_page_file_write_errno, {
if (enable_failpoint)
Expand All @@ -83,6 +84,7 @@ void writeFile(WritableFilePtr & file, UInt64 offset, char * data, size_t to_wri
errno = ENOSPC;
}
});
#endif
if ((-1 == res || 0 == res) && errno != EINTR)
{
ProfileEvents::increment(ProfileEvents::PSMWriteFailed);
Expand Down