From 65baef59a3ca9dbfbff8987229d486e576bba3c1 Mon Sep 17 00:00:00 2001 From: Nathan LaPre Date: Wed, 5 Apr 2023 21:35:49 +0000 Subject: [PATCH] Bug 1825516: Work around suspected gcc bug, r=morgan,eeejay This revision works around a suspected bug in gcc which was causing build failures. The compiler would complain that ApplyScrollOffset was protected, and therefore inaccessible, if we capture the return value of that function within BoundsWithOffset. I don't think this actually violates any C++ rules, and other compilers agree. To work around the problem, this revision wraps the call to ApplyScrollOffset in an immediately-invoked lambda, which satisfies gcc for some reason. Differential Revision: https://phabricator.services.mozilla.com/D174697 --- accessible/ipc/RemoteAccessibleBase.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/accessible/ipc/RemoteAccessibleBase.cpp b/accessible/ipc/RemoteAccessibleBase.cpp index da4c9f55160e..1077cac19368 100644 --- a/accessible/ipc/RemoteAccessibleBase.cpp +++ b/accessible/ipc/RemoteAccessibleBase.cpp @@ -699,7 +699,11 @@ LayoutDeviceIntRect RemoteAccessibleBase::BoundsWithOffset( // happens in this loop instead of both inside and outside of // the loop (like ApplyTransform). // Never apply scroll offsets past a fixed container. - const bool hasScrollArea = remoteAcc->ApplyScrollOffset(bounds); + // XXX: ApplyScrollOffset wrapped in an immediately-invoked lambda + // to work around a suspected gcc bug. See Bug 1825516. + const bool hasScrollArea = [&]() { + return remoteAcc->ApplyScrollOffset(bounds); + }(); // If we are hit testing and the Accessible has a scroll area, ensure // that the bounds we've calculated so far are constrained to the