Disable formatting on "contested lines" (#3714)

These lines are formatted differently between clang-format 10 (on CI) and clang-format 11+ (on most dev systems)
This commit is contained in:
pajlada 2022-05-07 16:57:26 +02:00 committed by GitHub
parent 66b9b04401
commit 4aa5b04e37
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 3 deletions

View file

@ -63,7 +63,10 @@ public:
void addLink(const QString &origLink, const QString &matchedLink);
template <typename T, typename... Args>
// clang-format off
// clang-format can be enabled once clang-format v11+ has been installed in CI
T *emplace(Args &&...args)
// clang-format on
{
static_assert(std::is_base_of<MessageElement, T>::value,
"T must extend MessageElement");

View file

@ -43,7 +43,10 @@ public:
}
template <typename T2, typename... Args>
// clang-format off
// clang-format can be enabled once clang-format v11+ has been installed in CI
LayoutCreator<T2> emplace(Args &&...args)
// clang-format on
{
T2 *t = new T2(std::forward<Args>(args)...);
@ -184,7 +187,10 @@ private:
};
template <typename T, typename... Args>
// clang-format off
// clang-format can be enabled once clang-format v11+ has been installed in CI
LayoutCreator<T> makeDialog(Args &&...args)
// clang-format on
{
T *t = new T(std::forward<Args>(args)...);
t->setAttribute(Qt::WA_DeleteOnClose);