From 7697b27ae87dded11394eec628b67c43ffc3ca3e Mon Sep 17 00:00:00 2001 From: Fabrice Le Goff Date: Tue, 17 Dec 2024 17:35:25 +0100 Subject: [PATCH 1/2] fix user-defined literal operator syntax (to make clang20 happy) --- Core/include/Acts/Definitions/Units.hpp | 4 ++-- Core/include/Acts/Utilities/HashedString.hpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Core/include/Acts/Definitions/Units.hpp b/Core/include/Acts/Definitions/Units.hpp index 65d7cee775d..3286077e3b0 100644 --- a/Core/include/Acts/Definitions/Units.hpp +++ b/Core/include/Acts/Definitions/Units.hpp @@ -202,10 +202,10 @@ constexpr double mol = 1.0; namespace UnitLiterals { // define user literal functions for the given unit constant #define ACTS_DEFINE_UNIT_LITERAL(name) \ - constexpr double operator"" _##name(long double x) { \ + constexpr double operator""_##name(long double x) { \ return ::Acts::UnitConstants::name * x; \ } \ - constexpr double operator"" _##name(unsigned long long x) { \ + constexpr double operator""_##name(unsigned long long x) { \ return ::Acts::UnitConstants::name * x; \ } ACTS_DEFINE_UNIT_LITERAL(fm) diff --git a/Core/include/Acts/Utilities/HashedString.hpp b/Core/include/Acts/Utilities/HashedString.hpp index 88b50a34d05..308c0482ba9 100644 --- a/Core/include/Acts/Utilities/HashedString.hpp +++ b/Core/include/Acts/Utilities/HashedString.hpp @@ -46,7 +46,7 @@ constexpr HashedString hashStringDynamic(std::string_view s) { } namespace HashedStringLiteral { -constexpr HashedString operator"" _hash(char const* s, std::size_t count) { +constexpr HashedString operator""_hash(char const* s, std::size_t count) { return detail::fnv1a_32(s, count); } From cb82fd5b6acbf3d089eb8f4198bac83e4975e602 Mon Sep 17 00:00:00 2001 From: Fabrice Le Goff Date: Wed, 18 Dec 2024 10:06:12 +0100 Subject: [PATCH 2/2] fix: clang-format --- Core/include/Acts/Definitions/Units.hpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Core/include/Acts/Definitions/Units.hpp b/Core/include/Acts/Definitions/Units.hpp index 3286077e3b0..a65e6945cfd 100644 --- a/Core/include/Acts/Definitions/Units.hpp +++ b/Core/include/Acts/Definitions/Units.hpp @@ -201,12 +201,12 @@ constexpr double mol = 1.0; namespace UnitLiterals { // define user literal functions for the given unit constant -#define ACTS_DEFINE_UNIT_LITERAL(name) \ - constexpr double operator""_##name(long double x) { \ - return ::Acts::UnitConstants::name * x; \ - } \ - constexpr double operator""_##name(unsigned long long x) { \ - return ::Acts::UnitConstants::name * x; \ +#define ACTS_DEFINE_UNIT_LITERAL(name) \ + constexpr double operator""_##name(long double x) { \ + return ::Acts::UnitConstants::name * x; \ + } \ + constexpr double operator""_##name(unsigned long long x) { \ + return ::Acts::UnitConstants::name * x; \ } ACTS_DEFINE_UNIT_LITERAL(fm) ACTS_DEFINE_UNIT_LITERAL(pm)