From 4a70fa052ff8aa34ceee50608cae54c00fd7ef3c Mon Sep 17 00:00:00 2001 From: Andrew Kaster Date: Sun, 26 Mar 2023 12:08:36 -0600 Subject: [PATCH] LibWeb: Declare defaulted style value comparision operators inline Some versions of clang, such as Apple clang-1400.0.29.202 error out on the previous out of line operators. Explicitly defaulting comparison operators out of line is allowed per P2085R0, but was checked in clang before version 15 in C++20 mode. --- Userland/Libraries/LibWeb/CSS/StyleValues/ContentStyleValue.cpp | 2 -- Userland/Libraries/LibWeb/CSS/StyleValues/ContentStyleValue.h | 2 +- .../LibWeb/CSS/StyleValues/GridAreaShorthandStyleValue.cpp | 2 -- .../LibWeb/CSS/StyleValues/GridAreaShorthandStyleValue.h | 2 +- 4 files changed, 2 insertions(+), 6 deletions(-) diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/ContentStyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValues/ContentStyleValue.cpp index 17d6be591a..5a476a21f8 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/ContentStyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/ContentStyleValue.cpp @@ -19,6 +19,4 @@ ErrorOr ContentStyleValue::to_string() const return m_properties.content->to_string(); } -bool ContentStyleValue::Properties::operator==(ContentStyleValue::Properties const&) const = default; - } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/ContentStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/ContentStyleValue.h index 761fa5501d..c628c0b0ee 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/ContentStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/ContentStyleValue.h @@ -39,7 +39,7 @@ private: struct Properties { ValueComparingNonnullRefPtr content; ValueComparingRefPtr alt_text; - bool operator==(Properties const&) const; + bool operator==(Properties const&) const = default; } m_properties; }; diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/GridAreaShorthandStyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValues/GridAreaShorthandStyleValue.cpp index 4b5ad35bc0..863067a51c 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/GridAreaShorthandStyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/GridAreaShorthandStyleValue.cpp @@ -40,6 +40,4 @@ ErrorOr GridAreaShorthandStyleValue::to_string() const return builder.to_string(); } -bool GridAreaShorthandStyleValue::Properties::operator==(GridAreaShorthandStyleValue::Properties const&) const = default; - } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/GridAreaShorthandStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/GridAreaShorthandStyleValue.h index 7d5e59d237..9f63da82ff 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/GridAreaShorthandStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/GridAreaShorthandStyleValue.h @@ -44,7 +44,7 @@ private: ValueComparingNonnullRefPtr column_start; ValueComparingNonnullRefPtr row_end; ValueComparingNonnullRefPtr column_end; - bool operator==(Properties const&) const; + bool operator==(Properties const&) const = default; } m_properties; };