Bug 264442 - Compilation failure using gcc (GCC) 13.2.1 20231011 (Red Hat 13.2.1-4)
Summary: Compilation failure using gcc (GCC) 13.2.1 20231011 (Red Hat 13.2.1-4)
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jean-Yves Avenard [:jya]
URL:
Keywords: InRadar
Depends on: 264393
Blocks:
  Show dependency treegraph
 
Reported: 2023-11-08 15:02 PST by Jean-Yves Avenard [:jya]
Modified: 2023-11-08 22:33 PST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jean-Yves Avenard [:jya] 2023-11-08 15:02:58 PST
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())) {
      |                        ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
Comment 1 Radar WebKit Bug Importer 2023-11-08 15:03:28 PST
<rdar://problem/118141764>
Comment 2 Jean-Yves Avenard [:jya] 2023-11-08 15:46:29 PST
Pull request: https://github.com/WebKit/WebKit/pull/20193
Comment 3 EWS 2023-11-08 22:33:53 PST
Committed 270421@main (f738f4311526): <https://commits.webkit.org/270421@main>

Reviewed commits have been landed. Closing PR #20193 and removing active labels.