public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/104575] New: noexcept operator rejects call to templated base class member function
@ 2022-02-16 21:07 oliver.rosten at googlemail dot com
2022-02-16 21:14 ` [Bug c++/104575] " pinskia at gcc dot gnu.org
0 siblings, 1 reply; 2+ messages in thread
From: oliver.rosten at googlemail dot com @ 2022-02-16 21:07 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104575
Bug ID: 104575
Summary: noexcept operator rejects call to templated base class
member function
Product: gcc
Version: 11.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: oliver.rosten at googlemail dot com
Target Milestone: ---
struct Y
{
void swap(Y& rhs) noexcept {}
};
template<class B>
struct D : B
{
void swap(D& rhs) noexcept (noexcept(B::swap(rhs))) {}
};
struct E : Y
{
void swap(E& rhs) noexcept (noexcept(Y::swap(rhs))) {}
};
void foo()
{
D<Y> x{}, y{};
x.swap(y); // Rejected
E u{}, v{};
u.swap(v); // OK
}
-----------
error: cannot call member function 'void Y::swap(Y&)' without object
https://godbolt.org/z/E3P9MEd6z
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug c++/104575] noexcept operator rejects call to templated base class member function
2022-02-16 21:07 [Bug c++/104575] New: noexcept operator rejects call to templated base class member function oliver.rosten at googlemail dot com
@ 2022-02-16 21:14 ` pinskia at gcc dot gnu.org
0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-02-16 21:14 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104575
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |DUPLICATE
Status|UNCONFIRMED |RESOLVED
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Dup of bug 94944.
*** This bug has been marked as a duplicate of bug 94944 ***
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-02-16 21:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-16 21:07 [Bug c++/104575] New: noexcept operator rejects call to templated base class member function oliver.rosten at googlemail dot com
2022-02-16 21:14 ` [Bug c++/104575] " pinskia at gcc dot gnu.org
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).