Seems to be this week's regression. On gcc-13 webkitgtk-2.38.5 fails to uild as: /home/slyfox/n/webkitgtk-2.38.5/Source/WebCore/platform/graphics/SourceBrush.cpp:68:78: error: converting to 'std::optional<WebCore::SourceBrush::Brush>' from initializer list would use explicit constructor 'constexpr std::optional<_Tp>::optional(_Up&&) [with _Up = WebCore::SourceBrush::Brush::LogicalGradient; typename std::enable_if<__and_v<std::__not_<std::is_same<std::optional<_Tp>, typename std::remove_cv<typename std::remove_reference<_Iter>::type>::type> >, std::__not_<std::is_same<std::in_place_t, typename std::remove_cv<typename std::remove_reference<_Iter>::type>::type> >, std::is_constructible<_Tp, _Up>, std::__not_<std::is_convertible<_Iter, _Iterator> > >, bool>::type <anonymous> = false; _Tp = WebCore::SourceBrush::Brush]' 68 | m_brush = { Brush::LogicalGradient { WTFMove(gradient), spaceTransform } }; | ^ gcc-12 is fine. I think this is the cmall example that illustrates the failure: // $ cat SourceBrush.cpp #include <optional> #include <variant> class RefGradient {}; class RefPattern {}; class AffineTransform {}; class SourceBrush { public: struct Brush { struct LogicalGradient { RefGradient gradient; AffineTransform spaceTransform; }; std::variant<LogicalGradient, RefPattern> brush; }; void setGradient(RefGradient &&, const AffineTransform & spaceTransform = { }); void setPattern(RefPattern &&); private: std::optional<Brush> m_brush; }; void SourceBrush::setGradient(RefGradient&& gradient, const AffineTransform& spaceTransform) { m_brush = { Brush::LogicalGradient { std::move(gradient), spaceTransform } }; } void SourceBrush::setPattern(RefPattern&& pattern) { m_brush = { std::move(pattern) }; } gcc-12 works: $ g++-12.2.0 SourceBrush.cpp -c -std=c++20 <ok> $ g++-13.0.0 SourceBrush.cpp -c -std=c++20 SourceBrush.cpp: In member function 'void SourceBrush::setGradient(RefGradient&&, const AffineTransform&)': SourceBrush.cpp:28:80: error: converting to 'std::optional<SourceBrush::Brush>' from initializer list would use explicit constructor 'constexpr std::optional<_Tp>::optional(_Up&&) [with _Up = SourceBrush::Brush::LogicalGradient; typename std::enable_if<__and_v<std::__not_<std::is_same<std::optional<_Tp>, typename std::remove_cv<typename std::remove_reference<_Iter>::type>::type> >, std::__not_<std::is_same<std::in_place_t, typename std::remove_cv<typename std::remove_reference<_Iter>::type>::type> >, std::is_constructible<_Tp, _Up>, std::__not_<std::is_convertible<_Up, _Tp> > >, bool>::type <anonymous> = false; _Tp = SourceBrush::Brush]' 28 | m_brush = { Brush::LogicalGradient { std::move(gradient), spaceTransform } }; | ^ SourceBrush.cpp: In member function 'void SourceBrush::setPattern(RefPattern&&)': SourceBrush.cpp:33:36: error: converting to 'std::optional<SourceBrush::Brush>' from initializer list would use explicit constructor 'constexpr std::optional<_Tp>::optional(_Up&&) [with _Up = RefPattern; typename std::enable_if<__and_v<std::__not_<std::is_same<std::optional<_Tp>, typename std::remove_cv<typename std::remove_reference<_Iter>::type>::type> >, std::__not_<std::is_same<std::in_place_t, typename std::remove_cv<typename std::remove_reference<_Iter>::type>::type> >, std::is_constructible<_Tp, _Up>, std::__not_<std::is_convertible<_Up, _Tp> > >, bool>::type <anonymous> = false; _Tp = SourceBrush::Brush]' 33 | m_brush = { std::move(pattern) }; | ^ $ g++-13.0.0 -v Using built-in specs. COLLECT_GCC=/<<NIX>>/gcc-13.0.0/bin/g++ COLLECT_LTO_WRAPPER=/<<NIX>>/gcc-13.0.0/libexec/gcc/x86_64-unknown-linux-gnu/13.0.1/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: Thread model: posix Supported LTO compression algorithms: zlib gcc version 13.0.1 20230326 (experimental) (GCC)
Dup. *** This bug has been marked as a duplicate of bug 109247 ***