diff --git a/.clang-tidy b/.clang-tidy index 2ca1402ddf1..860e7b3189f 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,6 +1,14 @@ +# To run clang-tidy from CMake, build ClickHouse with -DENABLE_CLANG_TIDY=1. To show all warnings, it is +# recommended to pass "-k0" to Ninja. + # Enable all checks + disale selected checks. Feel free to remove disabled checks from below list if # a) the new check is not controversial (this includes many checks in readability-* and google-*) or # b) too noisy (checks with > 100 new warnings are considered noisy, this includes e.g. cppcoreguidelines-*). + +# TODO Let clang-tidy check headers in further directories +# --> HeaderFilterRegex: '^.*/(src|base|programs|utils)/.*(h|hpp)$' +HeaderFilterRegex: '^.*/(base)/.*(h|hpp)$' + Checks: '*, -abseil-*, diff --git a/base/base/Decimal.h b/base/base/Decimal.h index 1efb8ba8d92..22cb577b1b2 100644 --- a/base/base/Decimal.h +++ b/base/base/Decimal.h @@ -52,15 +52,15 @@ struct Decimal constexpr Decimal(Decimal &&) noexcept = default; constexpr Decimal(const Decimal &) = default; - constexpr Decimal(const T & value_): value(value_) {} + constexpr Decimal(const T & value_): value(value_) {} // NOLINT(google-explicit-constructor) template - constexpr Decimal(const Decimal & x): value(x.value) {} + constexpr Decimal(const Decimal & x): value(x.value) {} // NOLINT(google-explicit-constructor) constexpr Decimal & operator=(Decimal &&) noexcept = default; constexpr Decimal & operator = (const Decimal &) = default; - constexpr operator T () const { return value; } + constexpr operator T () const { return value; } // NOLINT(google-explicit-constructor) template constexpr U convertTo() const @@ -111,7 +111,7 @@ public: using Base::Base; using NativeType = Base::NativeType; - constexpr DateTime64(const Base & v): Base(v) {} + constexpr DateTime64(const Base & v): Base(v) {} // NOLINT(google-explicit-constructor) }; } diff --git a/base/base/DecomposedFloat.h b/base/base/DecomposedFloat.h index 652b28966b2..f152637b94e 100644 --- a/base/base/DecomposedFloat.h +++ b/base/base/DecomposedFloat.h @@ -36,14 +36,14 @@ struct DecomposedFloat { using Traits = FloatTraits; - DecomposedFloat(T x) + explicit DecomposedFloat(T x) { memcpy(&x_uint, &x, sizeof(x)); } typename Traits::UInt x_uint; - bool is_negative() const + bool isNegative() const { return x_uint >> (Traits::bits - 1); } @@ -53,7 +53,7 @@ struct DecomposedFloat { return (exponent() == 0 && mantissa() == 0) ? 0 - : (is_negative() + : (isNegative() ? -1 : 1); } @@ -63,7 +63,7 @@ struct DecomposedFloat return (x_uint >> (Traits::mantissa_bits)) & (((1ull << (Traits::exponent_bits + 1)) - 1) >> 1); } - int16_t normalized_exponent() const + int16_t normalizedExponent() const { return int16_t(exponent()) - ((1ull << (Traits::exponent_bits - 1)) - 1); } @@ -73,20 +73,20 @@ struct DecomposedFloat return x_uint & ((1ull << Traits::mantissa_bits) - 1); } - int64_t mantissa_with_sign() const + int64_t mantissaWithSign() const { - return is_negative() ? -mantissa() : mantissa(); + return isNegative() ? -mantissa() : mantissa(); } /// NOTE Probably floating point instructions can be better. - bool is_integer_in_representable_range() const + bool isIntegerInRepresentableRange() const { return x_uint == 0 - || (normalized_exponent() >= 0 /// The number is not less than one + || (normalizedExponent() >= 0 /// The number is not less than one /// The number is inside the range where every integer has exact representation in float - && normalized_exponent() <= static_cast(Traits::mantissa_bits) + && normalizedExponent() <= static_cast(Traits::mantissa_bits) /// After multiplying by 2^exp, the fractional part becomes zero, means the number is integer - && ((mantissa() & ((1ULL << (Traits::mantissa_bits - normalized_exponent())) - 1)) == 0)); + && ((mantissa() & ((1ULL << (Traits::mantissa_bits - normalizedExponent())) - 1)) == 0)); } @@ -102,15 +102,15 @@ struct DecomposedFloat return sign(); /// Different signs - if (is_negative() && rhs > 0) + if (isNegative() && rhs > 0) return -1; - if (!is_negative() && rhs < 0) + if (!isNegative() && rhs < 0) return 1; /// Fractional number with magnitude less than one - if (normalized_exponent() < 0) + if (normalizedExponent() < 0) { - if (!is_negative()) + if (!isNegative()) return rhs > 0 ? -1 : 1; else return rhs >= 0 ? -1 : 1; @@ -121,11 +121,11 @@ struct DecomposedFloat { if (rhs == std::numeric_limits::lowest()) { - assert(is_negative()); + assert(isNegative()); - if (normalized_exponent() < static_cast(8 * sizeof(Int) - is_signed_v)) + if (normalizedExponent() < static_cast(8 * sizeof(Int) - is_signed_v)) return 1; - if (normalized_exponent() > static_cast(8 * sizeof(Int) - is_signed_v)) + if (normalizedExponent() > static_cast(8 * sizeof(Int) - is_signed_v)) return -1; if (mantissa() == 0) @@ -136,44 +136,44 @@ struct DecomposedFloat } /// Too large number: abs(float) > abs(rhs). Also the case with infinities and NaN. - if (normalized_exponent() >= static_cast(8 * sizeof(Int) - is_signed_v)) - return is_negative() ? -1 : 1; + if (normalizedExponent() >= static_cast(8 * sizeof(Int) - is_signed_v)) + return isNegative() ? -1 : 1; using UInt = std::conditional_t<(sizeof(Int) > sizeof(typename Traits::UInt)), make_unsigned_t, typename Traits::UInt>; UInt uint_rhs = rhs < 0 ? -rhs : rhs; /// Smaller octave: abs(rhs) < abs(float) /// FYI, TIL: octave is also called "binade", https://en.wikipedia.org/wiki/Binade - if (uint_rhs < (static_cast(1) << normalized_exponent())) - return is_negative() ? -1 : 1; + if (uint_rhs < (static_cast(1) << normalizedExponent())) + return isNegative() ? -1 : 1; /// Larger octave: abs(rhs) > abs(float) - if (normalized_exponent() + 1 < static_cast(8 * sizeof(Int) - is_signed_v) - && uint_rhs >= (static_cast(1) << (normalized_exponent() + 1))) - return is_negative() ? 1 : -1; + if (normalizedExponent() + 1 < static_cast(8 * sizeof(Int) - is_signed_v) + && uint_rhs >= (static_cast(1) << (normalizedExponent() + 1))) + return isNegative() ? 1 : -1; /// The same octave - /// uint_rhs == 2 ^ normalized_exponent + mantissa * 2 ^ (normalized_exponent - mantissa_bits) + /// uint_rhs == 2 ^ normalizedExponent + mantissa * 2 ^ (normalizedExponent - mantissa_bits) - bool large_and_always_integer = normalized_exponent() >= static_cast(Traits::mantissa_bits); + bool large_and_always_integer = normalizedExponent() >= static_cast(Traits::mantissa_bits); UInt a = large_and_always_integer - ? static_cast(mantissa()) << (normalized_exponent() - Traits::mantissa_bits) - : static_cast(mantissa()) >> (Traits::mantissa_bits - normalized_exponent()); + ? static_cast(mantissa()) << (normalizedExponent() - Traits::mantissa_bits) + : static_cast(mantissa()) >> (Traits::mantissa_bits - normalizedExponent()); - UInt b = uint_rhs - (static_cast(1) << normalized_exponent()); + UInt b = uint_rhs - (static_cast(1) << normalizedExponent()); if (a < b) - return is_negative() ? 1 : -1; + return isNegative() ? 1 : -1; if (a > b) - return is_negative() ? -1 : 1; + return isNegative() ? -1 : 1; /// Float has no fractional part means that the numbers are equal. - if (large_and_always_integer || (mantissa() & ((1ULL << (Traits::mantissa_bits - normalized_exponent())) - 1)) == 0) + if (large_and_always_integer || (mantissa() & ((1ULL << (Traits::mantissa_bits - normalizedExponent())) - 1)) == 0) return 0; else /// Float has fractional part means its abs value is larger. - return is_negative() ? -1 : 1; + return isNegative() ? -1 : 1; } diff --git a/base/base/JSON.h b/base/base/JSON.h index 214e9f88e9b..850b74715c6 100644 --- a/base/base/JSON.h +++ b/base/base/JSON.h @@ -38,6 +38,7 @@ */ +// NOLINTBEGIN(google-explicit-constructor) #ifdef __clang__ # pragma clang diagnostic push # pragma clang diagnostic ignored "-Wdeprecated-dynamic-exception-spec" @@ -46,6 +47,7 @@ POCO_DECLARE_EXCEPTION(Foundation_API, JSONException, Poco::Exception) #ifdef __clang__ # pragma clang diagnostic pop #endif +// NOLINTEND(google-explicit-constructor) class JSON { @@ -61,7 +63,7 @@ public: checkInit(); } - JSON(const std::string & s) : ptr_begin(s.data()), ptr_end(s.data() + s.size()), level(0) + explicit JSON(std::string_view s) : ptr_begin(s.data()), ptr_end(s.data() + s.size()), level(0) { checkInit(); } @@ -71,13 +73,7 @@ public: *this = rhs; } - JSON & operator=(const JSON & rhs) - { - ptr_begin = rhs.ptr_begin; - ptr_end = rhs.ptr_end; - level = rhs.level; - return *this; - } + JSON & operator=(const JSON & rhs) = default; const char * data() const { return ptr_begin; } const char * dataEnd() const { return ptr_end; } @@ -169,7 +165,7 @@ public: /// Перейти к следующему элементу массива или следующей name-value паре объекта. iterator & operator++(); - iterator operator++(int); + iterator operator++(int); // NOLINT(cert-dcl21-cpp) /// Есть ли в строке escape-последовательности bool hasEscapes() const; diff --git a/base/base/arithmeticOverflow.h b/base/base/arithmeticOverflow.h index 9a0e27505e1..d7242058658 100644 --- a/base/base/arithmeticOverflow.h +++ b/base/base/arithmeticOverflow.h @@ -3,6 +3,7 @@ #include #include +// NOLINTBEGIN(google-runtime-int) namespace common { @@ -206,3 +207,5 @@ namespace common return false; } } + +// NOLINTEND(google-runtime-int) diff --git a/base/base/bit_cast.h b/base/base/bit_cast.h index 5b4b0931b62..d1246b45590 100644 --- a/base/base/bit_cast.h +++ b/base/base/bit_cast.h @@ -1,6 +1,6 @@ #pragma once -#include +#include #include #include diff --git a/base/base/defines.h b/base/base/defines.h index c8c408b9c93..671253ed9e8 100644 --- a/base/base/defines.h +++ b/base/base/defines.h @@ -143,8 +143,8 @@ /// Macros for suppressing TSA warnings for specific reads/writes (instead of suppressing it for the whole function) /// Consider adding a comment before using these macros. -# define TSA_SUPPRESS_WARNING_FOR_READ(x) [&]() TSA_NO_THREAD_SAFETY_ANALYSIS -> const auto & { return (x); }() -# define TSA_SUPPRESS_WARNING_FOR_WRITE(x) [&]() TSA_NO_THREAD_SAFETY_ANALYSIS -> auto & { return (x); }() +# define TSA_SUPPRESS_WARNING_FOR_READ(x) ([&]() TSA_NO_THREAD_SAFETY_ANALYSIS -> const auto & { return (x); }()) +# define TSA_SUPPRESS_WARNING_FOR_WRITE(x) ([&]() TSA_NO_THREAD_SAFETY_ANALYSIS -> auto & { return (x); }()) /// This macro is useful when only one thread writes to a member /// and you want to read this member from the same thread without locking a mutex. diff --git a/base/base/extended_types.h b/base/base/extended_types.h index 7deb8e17b8e..b58df45a97e 100644 --- a/base/base/extended_types.h +++ b/base/base/extended_types.h @@ -5,7 +5,6 @@ #include #include - using Int128 = wide::integer<128, signed>; using UInt128 = wide::integer<128, unsigned>; using Int256 = wide::integer<256, signed>; @@ -18,7 +17,7 @@ static_assert(sizeof(UInt256) == 32); /// (std::common_type), are "set in stone". Attempting to specialize them causes undefined behavior. /// So instead of using the std type_traits, we use our own version which allows extension. template -struct is_signed +struct is_signed // NOLINT(readability-identifier-naming) { static constexpr bool value = std::is_signed_v; }; @@ -30,7 +29,7 @@ template inline constexpr bool is_signed_v = is_signed::value; template -struct is_unsigned +struct is_unsigned // NOLINT(readability-identifier-naming) { static constexpr bool value = std::is_unsigned_v; }; @@ -51,7 +50,7 @@ template concept is_integer = template concept is_floating_point = std::is_floating_point_v; template -struct is_arithmetic +struct is_arithmetic // NOLINT(readability-identifier-naming) { static constexpr bool value = std::is_arithmetic_v; }; @@ -66,9 +65,9 @@ template inline constexpr bool is_arithmetic_v = is_arithmetic::value; template -struct make_unsigned +struct make_unsigned // NOLINT(readability-identifier-naming) { - typedef std::make_unsigned_t type; + using type = std::make_unsigned_t; }; template <> struct make_unsigned { using type = UInt128; }; @@ -79,9 +78,9 @@ template <> struct make_unsigned { using type = UInt256; }; template using make_unsigned_t = typename make_unsigned::type; template -struct make_signed +struct make_signed // NOLINT(readability-identifier-naming) { - typedef std::make_signed_t type; + using type = std::make_signed_t; }; template <> struct make_signed { using type = Int128; }; @@ -92,7 +91,7 @@ template <> struct make_signed { using type = Int256; }; template using make_signed_t = typename make_signed::type; template -struct is_big_int +struct is_big_int // NOLINT(readability-identifier-naming) { static constexpr bool value = false; }; @@ -104,4 +103,3 @@ template <> struct is_big_int { static constexpr bool value = true; }; template inline constexpr bool is_big_int_v = is_big_int::value; - diff --git a/base/base/iostream_debug_helpers.h b/base/base/iostream_debug_helpers.h index 3a3f1a741ad..db974c911df 100644 --- a/base/base/iostream_debug_helpers.h +++ b/base/base/iostream_debug_helpers.h @@ -120,6 +120,7 @@ Out & dumpDispatchPriorities(Out & out, T && x, std::decay_t(out, x); } +// NOLINTNEXTLINE(google-explicit-constructor) struct LowPriority { LowPriority(void *) {} }; template diff --git a/base/base/itoa.h b/base/base/itoa.h index da7c2ffc73e..5e0b18d50c0 100644 --- a/base/base/itoa.h +++ b/base/base/itoa.h @@ -91,10 +91,10 @@ template using DivisionBy10PowN = typename SelectType < N, - Division, /// divide by 10 - Division, /// divide by 100 - Division, /// divide by 10000 - Division /// divide by 100000000 + Division, /// divide by 10 + Division, /// divide by 100 + Division, /// divide by 10000 + Division /// divide by 100000000 >::Result; template @@ -352,7 +352,7 @@ static inline char * writeUIntText(T x, char * p) static_assert(is_unsigned_v); int len = digits10(x); - auto pp = p + len; + auto * pp = p + len; while (x >= 100) { const auto i = x % 100; diff --git a/base/base/scope_guard.h b/base/base/scope_guard.h index 3d8f8ba0fe0..8524beac7ea 100644 --- a/base/base/scope_guard.h +++ b/base/base/scope_guard.h @@ -5,13 +5,13 @@ #include template -class [[nodiscard]] basic_scope_guard +class [[nodiscard]] BasicScopeGuard { public: - constexpr basic_scope_guard() = default; - constexpr basic_scope_guard(basic_scope_guard && src) : function{src.release()} {} + constexpr BasicScopeGuard() = default; + constexpr BasicScopeGuard(BasicScopeGuard && src) : function{src.release()} {} // NOLINT(hicpp-noexcept-move, performance-noexcept-move-constructor) - constexpr basic_scope_guard & operator=(basic_scope_guard && src) + constexpr BasicScopeGuard & operator=(BasicScopeGuard && src) // NOLINT(hicpp-noexcept-move, performance-noexcept-move-constructor) { if (this != &src) { @@ -23,11 +23,11 @@ public: template requires std::is_convertible_v - constexpr basic_scope_guard(basic_scope_guard && src) : function{src.release()} {} + constexpr BasicScopeGuard(BasicScopeGuard && src) : function{src.release()} {} // NOLINT(google-explicit-constructor) template requires std::is_convertible_v - constexpr basic_scope_guard & operator=(basic_scope_guard && src) + constexpr BasicScopeGuard & operator=(BasicScopeGuard && src) { if (this != &src) { @@ -39,13 +39,13 @@ public: template requires std::is_convertible_v - constexpr basic_scope_guard(const G & function_) : function{function_} {} + constexpr BasicScopeGuard(const G & function_) : function{function_} {} // NOLINT(google-explicit-constructor) template requires std::is_convertible_v - constexpr basic_scope_guard(G && function_) : function{std::move(function_)} {} + constexpr BasicScopeGuard(G && function_) : function{std::move(function_)} {} // NOLINT(google-explicit-constructor, bugprone-forwarding-reference-overload, bugprone-move-forwarding-reference) - ~basic_scope_guard() { invoke(); } + ~BasicScopeGuard() { invoke(); } static constexpr bool is_nullable = std::is_constructible_v; @@ -70,7 +70,7 @@ public: template requires std::is_convertible_v - basic_scope_guard & join(basic_scope_guard && other) + BasicScopeGuard & join(BasicScopeGuard && other) { if (other.function) { @@ -102,14 +102,13 @@ private: F function = F{}; }; -using scope_guard = basic_scope_guard>; +using scope_guard = BasicScopeGuard>; template -inline basic_scope_guard make_scope_guard(F && function_) { return std::forward(function_); } +inline BasicScopeGuard make_scope_guard(F && function_) { return std::forward(function_); } #define SCOPE_EXIT_CONCAT(n, ...) \ const auto scope_exit##n = make_scope_guard([&] { __VA_ARGS__; }) #define SCOPE_EXIT_FWD(n, ...) SCOPE_EXIT_CONCAT(n, __VA_ARGS__) #define SCOPE_EXIT(...) SCOPE_EXIT_FWD(__LINE__, __VA_ARGS__) - diff --git a/base/base/sort.h b/base/base/sort.h index 589469fffaa..912545979dc 100644 --- a/base/base/sort.h +++ b/base/base/sort.h @@ -14,7 +14,7 @@ template class DebugLessComparator { public: - constexpr DebugLessComparator(Comparator & cmp_) + constexpr DebugLessComparator(Comparator & cmp_) // NOLINT(google-explicit-constructor) : cmp(cmp_) {} diff --git a/base/base/strong_typedef.h b/base/base/strong_typedef.h index c9ea30b73fd..2ddea6412f5 100644 --- a/base/base/strong_typedef.h +++ b/base/base/strong_typedef.h @@ -34,8 +34,10 @@ public: template ::type> Self & operator=(T && rhs) { t = std::move(rhs); return *this;} + // NOLINTBEGIN(google-explicit-constructor) operator const T & () const { return t; } operator T & () { return t; } + // NOLINTEND(google-explicit-constructor) bool operator==(const Self & rhs) const { return t == rhs.t; } bool operator<(const Self & rhs) const { return t < rhs.t; } @@ -58,7 +60,10 @@ namespace std }; } +// NOLINTBEGIN(bugprone-macro-parentheses) + #define STRONG_TYPEDEF(T, D) \ struct D ## Tag {}; \ using D = StrongTypedef; \ +// NOLINTEND(bugprone-macro-parentheses) diff --git a/base/base/unit.h b/base/base/unit.h index 682b43512fc..1fb530be1f0 100644 --- a/base/base/unit.h +++ b/base/base/unit.h @@ -10,9 +10,11 @@ constexpr size_t GiB = 1024 * MiB; # pragma clang diagnostic ignored "-Wreserved-identifier" #endif +// NOLINTBEGIN(google-runtime-int) constexpr size_t operator"" _KiB(unsigned long long val) { return val * KiB; } constexpr size_t operator"" _MiB(unsigned long long val) { return val * MiB; } constexpr size_t operator"" _GiB(unsigned long long val) { return val * GiB; } +// NOLINTEND(google-runtime-int) #ifdef HAS_RESERVED_IDENTIFIER # pragma clang diagnostic pop diff --git a/base/base/wide_integer_to_string.h b/base/base/wide_integer_to_string.h index 8b794fe9bcb..160bf599516 100644 --- a/base/base/wide_integer_to_string.h +++ b/base/base/wide_integer_to_string.h @@ -51,8 +51,8 @@ struct fmt::formatter> { constexpr auto parse(format_parse_context & ctx) { - auto it = ctx.begin(); - auto end = ctx.end(); + const auto * it = ctx.begin(); + const auto * end = ctx.end(); /// Only support {}. if (it != end && *it != '}') diff --git a/base/pcg-random/pcg_extras.hpp b/base/pcg-random/pcg_extras.hpp index f5ba4d48849..78ce726d48b 100644 --- a/base/pcg-random/pcg_extras.hpp +++ b/base/pcg-random/pcg_extras.hpp @@ -49,6 +49,8 @@ #include #endif +// NOLINTBEGIN(readability-identifier-naming, modernize-use-using, bugprone-macro-parentheses, google-explicit-constructor) + /* * Abstractions for compiler-specific directives */ @@ -90,8 +92,6 @@ #define PCG_EMULATED_128BIT_MATH 1 #endif -// NOLINTBEGIN(*) - namespace pcg_extras { /* @@ -553,6 +553,6 @@ std::ostream& operator<<(std::ostream& out, printable_typename) { } // namespace pcg_extras -// NOLINTEND(*) +// NOLINTEND(readability-identifier-naming, modernize-use-using, bugprone-macro-parentheses, google-explicit-constructor) #endif // PCG_EXTRAS_HPP_INCLUDED diff --git a/src/Backups/BackupImpl.cpp b/src/Backups/BackupImpl.cpp index 110e358571f..ffd20e02dd3 100644 --- a/src/Backups/BackupImpl.cpp +++ b/src/Backups/BackupImpl.cpp @@ -537,7 +537,7 @@ SizeAndChecksum BackupImpl::getFileSizeAndChecksum(const String & file_name) con if (!info) throw Exception( ErrorCodes::BACKUP_ENTRY_NOT_FOUND, "Backup {}: Entry {} not found in the backup", backup_name, quoteString(file_name)); - return std::pair(info->size, info->checksum); + return {info->size, info->checksum}; } BackupEntryPtr BackupImpl::readFile(const String & file_name) const diff --git a/src/IO/WriteHelpers.h b/src/IO/WriteHelpers.h index f9892ac6194..7acea87c0d7 100644 --- a/src/IO/WriteHelpers.h +++ b/src/IO/WriteHelpers.h @@ -146,14 +146,14 @@ inline size_t writeFloatTextFastPath(T x, char * buffer) /// The library Ryu has low performance on integers. /// This workaround improves performance 6..10 times. - if (DecomposedFloat64(x).is_integer_in_representable_range()) + if (DecomposedFloat64(x).isIntegerInRepresentableRange()) result = itoa(Int64(x), buffer) - buffer; else result = jkj::dragonbox::to_chars_n(x, buffer) - buffer; } else { - if (DecomposedFloat32(x).is_integer_in_representable_range()) + if (DecomposedFloat32(x).isIntegerInRepresentableRange()) result = itoa(Int32(x), buffer) - buffer; else result = jkj::dragonbox::to_chars_n(x, buffer) - buffer; diff --git a/src/Processors/Merges/Algorithms/Graphite.cpp b/src/Processors/Merges/Algorithms/Graphite.cpp index 2448a1e2a94..c5c611366ff 100644 --- a/src/Processors/Merges/Algorithms/Graphite.cpp +++ b/src/Processors/Merges/Algorithms/Graphite.cpp @@ -103,17 +103,17 @@ Graphite::RollupRule selectPatternForPath( if (first_match->type == first_match->TypeUndef && pattern.type == pattern.TypeAll) { /// There is only default pattern for both retention and aggregation - return std::pair(&pattern, &pattern); + return {&pattern, &pattern}; } if (pattern.type != first_match->type) { if (first_match->type == first_match->TypeRetention) { - return std::pair(first_match, &pattern); + return {first_match, &pattern}; } if (first_match->type == first_match->TypeAggregation) { - return std::pair(&pattern, first_match); + return {&pattern, first_match}; } } } @@ -125,7 +125,7 @@ Graphite::RollupRule selectPatternForPath( if (pattern.type == pattern.TypeAll) { /// Only for not default patterns with both function and retention parameters - return std::pair(&pattern, &pattern); + return {&pattern, &pattern}; } if (first_match->type == first_match->TypeUndef) { @@ -136,11 +136,11 @@ Graphite::RollupRule selectPatternForPath( { if (first_match->type == first_match->TypeRetention) { - return std::pair(first_match, &pattern); + return {first_match, &pattern}; } if (first_match->type == first_match->TypeAggregation) { - return std::pair(&pattern, first_match); + return {&pattern, first_match}; } } } diff --git a/tests/instructions/clang-tidy.txt b/tests/instructions/clang-tidy.txt deleted file mode 100644 index 84145564bf0..00000000000 --- a/tests/instructions/clang-tidy.txt +++ /dev/null @@ -1,2 +0,0 @@ -# clang-tidy has been integrated into CMake: -# --> Build ClickHouse with -DENABLE_CLANG_TIDY=1 and see cmake/clang_tidy.cmake for details