Bug 264442
| Summary: | Compilation failure using gcc (GCC) 13.2.1 20231011 (Red Hat 13.2.1-4) | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Jean-Yves Avenard [:jya] <jean-yves.avenard> |
| Component: | DOM | Assignee: | Jean-Yves Avenard [:jya] <jean-yves.avenard> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Bug Depends on: | 264393 | ||
| Bug Blocks: | |||
Jean-Yves Avenard [:jya]
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())) {
| ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/118141764>
Jean-Yves Avenard [:jya]
Pull request: https://github.com/WebKit/WebKit/pull/20193
EWS
Committed 270421@main (f738f4311526): <https://commits.webkit.org/270421@main>
Reviewed commits have been landed. Closing PR #20193 and removing active labels.