Created attachment 447403 [details] Example that fails with GCC-9 and builds with GCC-10 Attached minimal example built with snippets from Span.h and its usage in AccessibilityRenderObject.cpp (Link to compiler explorer: https://godbolt.org/z/qxTK1qdda) Minimum GCC working version: gcc 10 Minimum CLANG working version: clang 7 List of C++ features supported by GCC: https://gcc.gnu.org/projects/cxx-status.html List of C++ GCC 10 changes: https://gcc.gnu.org/gcc-10/changes.html#cxx Link to build job of the first failure: https://build.webkit.org/#/builders/46/builds/9542 ../../Source/WebCore/accessibility/AccessibilityRenderObject.cpp: In member function ‘virtual bool WebCore::AccessibilityRenderObject::inheritsPresentationalRole() const’: ../../Source/WebCore/accessibility/AccessibilityRenderObject.cpp:3222:22: error: no match for ‘operator=’ (operand types are ‘WTF::Span<const WTF::LazyNeverDestroyed<const WebCore::HTMLQualifiedName>* const>’ and ‘const std::array<WTF::LazyNeverDestroyed<const WebCore::HTMLQualifiedName>*, 3>’) parentTags = listItemParents; ^~~~~~~~~~~~~~~ In file included from WTF/Headers/wtf/Vector.h:37, from WTF/Headers/wtf/Threading.h:48, from WTF/Headers/wtf/WeakPtr.h:31, from WTF/Headers/wtf/text/TextStream.h:33, from WTF/Headers/wtf/ObjectIdentifier.h:32, from ../../Source/WebCore/page/FrameIdentifier.h:28, from ../../Source/WebCore/loader/FrameLoaderClient.h:32, from ../../Source/WebCore/accessibility/AccessibilityObjectInterface.h:30, from ../../Source/WebCore/accessibility/AccessibilityObject.h:32, from ../../Source/WebCore/accessibility/AccessibilityMockObject.h:28, from ../../Source/WebCore/accessibility/AccessibilityMockObject.cpp:27, from WebCore/DerivedSources/unified-sources/UnifiedSource-aba958d6-3.cpp:1: WTF/Headers/wtf/Span.h:289:21: note: candidate: ‘constexpr WTF::Span<_Tp, 18446744073709551615>& WTF::Span<_Tp, 18446744073709551615>::operator=(const WTF::Span<_Tp, 18446744073709551615>&) [with _Tp = const WTF::LazyNeverDestroyed<const WebCore::HTMLQualifiedName>* const]’ constexpr Span& operator=(const Span&) noexcept = default; ^~~~~~~~ WTF/Headers/wtf/Span.h:289:21: note: no known conversion for argument 1 from ‘const std::array<WTF::LazyNeverDestroyed<const WebCore::HTMLQualifiedName>*, 3>’ to ‘const WTF::Span<const WTF::LazyNeverDestroyed<const WebCore::HTMLQualifiedName>* const>&’ In file included from WebCore/DerivedSources/unified-sources/UnifiedSource-aba958d6-3.cpp:5:
GCC 8 also fails with the same error than GCC 9 (GCC 8 is still supported) The example builds fine with "-std=c++17" on GCC-10 but not on 9 and 10. And according to https://gcc.gnu.org/projects/cxx-status.html GCC 8 already has full support for C++-17 So maybe this is a bug on the compiler, hard to tell.
Would be nice to find a workaround too.
This info is maybe useful, Clang 6 fails with the same error (or very similar). $ clang++-6.0 -std=c++17 span_gcc.cpp span_gcc.cpp:211:10: error: no viable overloaded '=' span = arr; ~~~~ ^ ~~~ span_gcc.cpp:150:21: note: candidate function not viable: no known conversion from 'const std::array<int *, 3>' to 'const Span<const int *const, 18446744073709551615>' for 1st argument constexpr Span& operator=(const Span&) noexcept = default; ^ 1 error generated. And clang++-7 builds it fine
Created attachment 447413 [details] Patch
Committed r287173 (245343@main): <https://commits.webkit.org/245343@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 447413 [details].
<rdar://problem/86614849>