public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "slyfox at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/109307] New: [13 Regression] constructors fails typecheck on initializer list assignment Date: Mon, 27 Mar 2023 22:27:14 +0000 [thread overview] Message-ID: <bug-109307-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109307 Bug ID: 109307 Summary: [13 Regression] constructors fails typecheck on initializer list assignment Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: slyfox at gcc dot gnu.org Target Milestone: --- 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)
next reply other threads:[~2023-03-27 22:27 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-03-27 22:27 slyfox at gcc dot gnu.org [this message] 2023-03-27 22:29 ` [Bug c++/109307] " jakub at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-109307-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).