When compiling with a very recent gcc, we get the compilation error: ``` /home/jyavenard/Work/webkit/OpenSource/Source/WebCore/dom/TreeScopeOrderedMap.cpp: In instantiation of ‘WTF::RefPtr<WebCore::Element> WebCore::TreeScopeOrderedMap::get(const WTF::AtomString&, const WebCore::TreeScope&, const KeyMatchingFunction&) const [with KeyMatchingFunction = WebCore::TreeScopeOrderedMap::getElementById(const WTF::AtomString&, const WebCore::TreeScope&) const::<lambda(const WTF::AtomString&, const WebCore::Element&)>]’: /home/jyavenard/Work/webkit/OpenSource/Source/WebCore/dom/TreeScopeOrderedMap.cpp:180:15: required from here /home/jyavenard/Work/webkit/OpenSource/Source/WebCore/dom/TreeScopeOrderedMap.cpp:121:5: error: possibly dangling reference to a temporary [-Werror=dangling-reference] 121 | for (Ref element : descendantsOfType<Element>(scope.protectedRootNode().get())) { | ^~~ /home/jyavenard/Work/webkit/OpenSource/Source/WebCore/dom/TreeScopeOrderedMap.cpp:121:50: note: the temporary was destroyed at the end of the full expression ‘WebCore::descendantsOfType<Element>((* & WebCore::TreeScope::protectedRootNode() const().WTF::Ref<WebCore::ContainerNode>::get()))’ 121 | for (Ref element : descendantsOfType<Element>(scope.protectedRootNode().get())) { | ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/jyavenard/Work/webkit/OpenSource/Source/WebCore/dom/TreeScopeOrderedMap.cpp: In instantiation of ‘WTF::RefPtr<WebCore::Element> WebCore::TreeScopeOrderedMap::get(const WTF::AtomString&, const WebCore::TreeScope&, const KeyMatchingFunction&) const [with KeyMatchingFunction = WebCore::TreeScopeOrderedMap::getElementByName(const WTF::AtomString&, const WebCore::TreeScope&) const::<lambda(const WTF::AtomString&, const WebCore::Element&)>]’: /home/jyavenard/Work/webkit/OpenSource/Source/WebCore/dom/TreeScopeOrderedMap.cpp:187:15: required from here /home/jyavenard/Work/webkit/OpenSource/Source/WebCore/dom/TreeScopeOrderedMap.cpp:121:5: error: possibly dangling reference to a temporary [-Werror=dangling-reference] 121 | for (Ref element : descendantsOfType<Element>(scope.protectedRootNode().get())) { | ^~~ /home/jyavenard/Work/webkit/OpenSource/Source/WebCore/dom/TreeScopeOrderedMap.cpp:121:50: note: the temporary was destroyed at the end of the full expression ‘WebCore::descendantsOfType<Element>((* & WebCore::TreeScope::protectedRootNode() const().WTF::Ref<WebCore::ContainerNode>::get()))’ 121 | for (Ref element : descendantsOfType<Element>(scope.protectedRootNode().get())) { | ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/jyavenard/Work/webkit/OpenSource/Source/WebCore/dom/TreeScopeOrderedMap.cpp: In instantiation of ‘WTF::RefPtr<WebCore::Element> WebCore::TreeScopeOrderedMap::get(const WTF::AtomString&, const WebCore::TreeScope&, const KeyMatchingFunction&) const [with KeyMatchingFunction = WebCore::TreeScopeOrderedMap::getElementByMapName(const WTF::AtomString&, const WebCore::TreeScope&) const::<lambda(const WTF::AtomString&, const WebCore::Element&)>]’: /home/jyavenard/Work/webkit/OpenSource/Source/WebCore/dom/TreeScopeOrderedMap.cpp:194:40: required from here /home/jyavenard/Work/webkit/OpenSource/Source/WebCore/dom/TreeScopeOrderedMap.cpp:121:5: error: possibly dangling reference to a temporary [-Werror=dangling-reference] 121 | for (Ref element : descendantsOfType<Element>(scope.protectedRootNode().get())) { | ^~~ /home/jyavenard/Work/webkit/OpenSource/Source/WebCore/dom/TreeScopeOrderedMap.cpp:121:50: note: the temporary was destroyed at the end of the full expression ‘WebCore::descendantsOfType<Element>((* & WebCore::TreeScope::protectedRootNode() const().WTF::Ref<WebCore::ContainerNode>::get()))’ 121 | for (Ref element : descendantsOfType<Element>(scope.protectedRootNode().get())) { | ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ```
<rdar://problem/118141764>
Pull request: https://github.com/WebKit/WebKit/pull/20193
Committed 270421@main (f738f4311526): <https://commits.webkit.org/270421@main> Reviewed commits have been landed. Closing PR #20193 and removing active labels.