Skip to content

Commit

Permalink
Update clang-format version to the latest (19.1.7) (#3782)
Browse files Browse the repository at this point in the history
Get new version at: https://pypi.org/project/clang-format/

The new version seems to format better, see diff.
  • Loading branch information
zasdfgbnm authored Jan 29, 2025
1 parent 76fec33 commit 7d94abe
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .lintrunner.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ init_command = [
'python3',
'tools/linter/adapters/pip_init.py',
'--dry-run={{DRYRUN}}',
'clang-format==18.1.8',
'clang-format==19.1.7',
]
is_formatter = true

Expand Down
2 changes: 1 addition & 1 deletion csrc/polymorphic_value.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ class StructHandle {

template <typename Ret, typename Class>
inline std::enable_if_t<std::is_base_of_v<Struct, Class>, Ret&> operator->*(
Ret Class::*member) const {
Ret Class::* member) const {
return as<Class>().*member;
}

Expand Down
14 changes: 5 additions & 9 deletions lib/dynamic_type/src/dynamic_type/dynamic_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,7 @@ struct DynamicType {
constexpr DynamicType(T&& value) : value(std::forward<T>(value)) {}

template <
template <typename...>
typename Template,
template <typename...> typename Template,
typename ItemT,
typename = std::enable_if_t<
is_candidate_type<Template<DynamicType>> &&
Expand Down Expand Up @@ -316,16 +315,14 @@ struct DynamicType {
}

template <
template <typename...>
typename Template,
template <typename...> typename Template,
typename = std::enable_if_t<is_candidate_type<Template<DynamicType>>>>
constexpr const Template<DynamicType>& as() const {
return as<Template<DynamicType>>();
}

template <
template <typename...>
typename Template,
template <typename...> typename Template,
typename = std::enable_if_t<is_candidate_type<Template<DynamicType>>>>
constexpr Template<DynamicType>& as() {
return as<Template<DynamicType>>();
Expand All @@ -344,8 +341,7 @@ struct DynamicType {
}

template <
template <typename...>
typename Template,
template <typename...> typename Template,
typename ItemT,
typename = std::enable_if_t<
is_candidate_type<Template<DynamicType>> && can_cast_to<ItemT>>>
Expand Down Expand Up @@ -488,7 +484,7 @@ struct DynamicType {
typename Ret, \
typename Class, \
typename = std::enable_if_t<is_candidate_type<Class>>> \
constexpr decltype(auto) operator->*(Ret Class::*member) __const { \
constexpr decltype(auto) operator->*(Ret Class::* member) __const { \
/* Use decltype(auto) instead of auto as return type so that references */ \
/* and qualifiers are preserved*/ \
if constexpr (std::is_function_v<Ret>) { \
Expand Down
8 changes: 4 additions & 4 deletions lib/dynamic_type/test/member.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,19 @@ struct E {
struct CD {
std::variant<C, D> v;

constexpr const int& operator->*(int C::*member) const {
constexpr const int& operator->*(int C::* member) const {
return std::get<C>(v).*member;
}

constexpr const int& operator->*(int D::*member) const {
constexpr const int& operator->*(int D::* member) const {
return std::get<D>(v).*member;
}

constexpr int& operator->*(int C::*member) {
constexpr int& operator->*(int C::* member) {
return std::get<C>(v).*member;
}

constexpr int& operator->*(int D::*member) {
constexpr int& operator->*(int D::* member) {
return std::get<D>(v).*member;
}
};
Expand Down
2 changes: 1 addition & 1 deletion lib/dynamic_type/test/opcheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ static_assert(!opcheck<int>->value());

// Arrow star operator
struct OverloadArrowStar {
auto operator->*(int OverloadArrowStar::*memberPtr) const -> int* {
auto operator->*(int OverloadArrowStar::* memberPtr) const -> int* {
return nullptr;
}
};
Expand Down
3 changes: 1 addition & 2 deletions runtime/fused_welford_helper.cu
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ template <
int NumVals,
typename DataTypeT,
typename IndexTypeT,
template <int, typename>
typename MakeTuple>
template <int, typename> typename MakeTuple>
struct WelfordTripletTuple {
static constexpr int num_vals = NumVals;
using DataType = DataTypeT;
Expand Down

0 comments on commit 7d94abe

Please sign in to comment.