From 5812cd9bc2c15a034db24e0d2a43cc923d8a66cc Mon Sep 17 00:00:00 2001 From: Jose Dapena Paz Date: Thu, 20 Feb 2020 13:00:16 +0100 Subject: [PATCH] GCC: DOMRect constexpr equal operator depends on non constexpr operators Make accessors of DOMRectReadOnly constexpr so the equal operator can be also constexpr. ../../third_party/blink/renderer/core/geometry/dom_rect.h: In function ‘constexpr bool blink::operator==(const blink::DOMRect&, const blink::DOMRect&)’: ../../third_party/blink/renderer/core/geometry/dom_rect.h:38:15: error: call to non-‘constexpr’ function ‘double blink::DOMRectReadOnly::x() const’ Bug: 819294 Change-Id: Ic1fed89c5480ce4eedaaf7add2779d000b77cc48 --- diff --git a/third_party/blink/renderer/core/geometry/dom_rect_read_only.h b/third_party/blink/renderer/core/geometry/dom_rect_read_only.h index 0c3f84c..71f193e 100644 --- a/third_party/blink/renderer/core/geometry/dom_rect_read_only.h +++ b/third_party/blink/renderer/core/geometry/dom_rect_read_only.h @@ -31,10 +31,10 @@ class CORE_EXPORT DOMRectReadOnly : public ScriptWrappable { DOMRectReadOnly(double x, double y, double width, double height); - double x() const { return x_; } - double y() const { return y_; } - double width() const { return width_; } - double height() const { return height_; } + constexpr double x() const { return x_; } + constexpr double y() const { return y_; } + constexpr double width() const { return width_; } + constexpr double height() const { return height_; } double top() const { return geometry_util::NanSafeMin(y_, y_ + height_); } double right() const { return geometry_util::NanSafeMax(x_, x_ + width_); }