From e3648454565ec984c4fa2222a5e11c512c8902d3 Mon Sep 17 00:00:00 2001 From: Daniel Bertalan Date: Sun, 20 Jun 2021 21:11:29 +0200 Subject: [PATCH] LibGfx: Don't `constexpr` functions returning Strings Since strings don't have a constexpr constructor, these won't have any effect anyways. Furthermore, this is explicitly disallowed by the standard, and makes Clang tools freak out. --- Userland/Libraries/LibGfx/Vector2.h | 2 +- Userland/Libraries/LibGfx/Vector3.h | 2 +- Userland/Libraries/LibGfx/Vector4.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Userland/Libraries/LibGfx/Vector2.h b/Userland/Libraries/LibGfx/Vector2.h index 16e9d06023..b4a68a06df 100644 --- a/Userland/Libraries/LibGfx/Vector2.h +++ b/Userland/Libraries/LibGfx/Vector2.h @@ -108,7 +108,7 @@ public: return sqrt(m_x * m_x + m_y * m_y); } - constexpr String to_string() const + String to_string() const { return String::formatted("[{},{}]", x(), y()); } diff --git a/Userland/Libraries/LibGfx/Vector3.h b/Userland/Libraries/LibGfx/Vector3.h index 7bad4f09b9..6f6c41d0c7 100644 --- a/Userland/Libraries/LibGfx/Vector3.h +++ b/Userland/Libraries/LibGfx/Vector3.h @@ -124,7 +124,7 @@ public: return sqrt(m_x * m_x + m_y * m_y + m_z * m_z); } - constexpr String to_string() const + String to_string() const { return String::formatted("[{},{},{}]", x(), y(), z()); } diff --git a/Userland/Libraries/LibGfx/Vector4.h b/Userland/Libraries/LibGfx/Vector4.h index 1f7699f6f0..c7570ea852 100644 --- a/Userland/Libraries/LibGfx/Vector4.h +++ b/Userland/Libraries/LibGfx/Vector4.h @@ -124,7 +124,7 @@ public: return sqrt(m_x * m_x + m_y * m_y + m_z * m_z + m_w * m_w); } - constexpr String to_string() const + String to_string() const { return String::formatted("[{},{},{},{}]", x(), y(), z(), w()); }