diff --git a/src/Functions/GatherUtils/CMakeLists.txt b/src/Functions/GatherUtils/CMakeLists.txt index 3f7f08621a1..f941091667e 100644 --- a/src/Functions/GatherUtils/CMakeLists.txt +++ b/src/Functions/GatherUtils/CMakeLists.txt @@ -3,6 +3,17 @@ add_headers_and_sources(clickhouse_functions_gatherutils .) add_library(clickhouse_functions_gatherutils ${clickhouse_functions_gatherutils_sources} ${clickhouse_functions_gatherutils_headers}) target_link_libraries(clickhouse_functions_gatherutils PRIVATE dbms) +check_cxx_compiler_flag(suggest-override HAS_SUGGEST_OVERRIDE) +check_cxx_compiler_flag(suggest-destructor-override HAS_SUGGEST_DESTRUCTOR_OVERRIDE) + +if (HAS_SUGGEST_OVERRIDE) + target_compile_definitions(clickhouse_functions_gatherutils PRIVATE HAS_SUGGEST_OVERRIDE) +endif() + +if (HAS_SUGGEST_DESTRUCTOR_OVERRIDE) + target_compile_definitions(clickhouse_functions_gatherutils PRIVATE HAS_SUGGEST_DESTRUCTOR_OVERRIDE) +endif() + if (STRIP_DEBUG_SYMBOLS_FUNCTIONS) target_compile_options(clickhouse_functions_gatherutils PRIVATE "-g0") endif() diff --git a/src/Functions/GatherUtils/Sources.h b/src/Functions/GatherUtils/Sources.h index 299884e1c9e..fe71a1f8be3 100644 --- a/src/Functions/GatherUtils/Sources.h +++ b/src/Functions/GatherUtils/Sources.h @@ -129,9 +129,13 @@ struct NumericArraySource : public ArraySourceImpl> #pragma GCC diagnostic ignored "-Wsuggest-override" #elif __clang_major__ >= 11 #pragma GCC diagnostic push +#ifdef HAS_SUGGEST_OVERRIDE #pragma GCC diagnostic ignored "-Wsuggest-override" +#endif +#ifdef HAS_SUGGEST_DESTRUCTOR_OVERRIDE #pragma GCC diagnostic ignored "-Wsuggest-destructor-override" #endif +#endif template struct ConstSource : public Base