diff --git a/dbms/src/Columns/ColumnVector.cpp b/dbms/src/Columns/ColumnVector.cpp index 7d053f51796..3fca0266299 100644 --- a/dbms/src/Columns/ColumnVector.cpp +++ b/dbms/src/Columns/ColumnVector.cpp @@ -19,12 +19,6 @@ #include #endif -// Allow std::pair copying -#if defined(__GNUC__) && !defined(__clang__) && (__GNUC__ >= 8) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wclass-memaccess" -#endif - namespace DB { @@ -355,7 +349,4 @@ template class ColumnVector; template class ColumnVector; template class ColumnVector; template class ColumnVector; -#if defined(__GNUC__) && !defined(__clang__) && (__GNUC__ >= 8) -#pragma GCC diagnostic pop -#endif } diff --git a/dbms/src/Common/RadixSort.h b/dbms/src/Common/RadixSort.h index 48fbdce8096..c3083e088da 100644 --- a/dbms/src/Common/RadixSort.h +++ b/dbms/src/Common/RadixSort.h @@ -195,6 +195,11 @@ struct RadixSortPairIntKeyTraits }; +// Allow std::pair copying +#if defined(__GNUC__) && !defined(__clang__) && (__GNUC__ >= 8) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wclass-memaccess" +#endif template struct RadixSort { @@ -289,7 +294,9 @@ public: allocator.deallocate(swap_buffer, size * sizeof(Element)); } }; - +#if defined(__GNUC__) && !defined(__clang__) && (__GNUC__ >= 8) +#pragma GCC diagnostic pop +#endif template std::enable_if_t && std::is_integral_v, void>