public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/112908] New: __reference_{converts,constructs}_from_temporary checks for move constructor when binding prvalue to reference of the same type
@ 2023-12-07 21:51 mital at mitalashok dot co.uk
2023-12-20 16:13 ` [Bug c++/112908] " ppalka at gcc dot gnu.org
2023-12-20 16:27 ` mpolacek at gcc dot gnu.org
0 siblings, 2 replies; 3+ messages in thread
From: mital at mitalashok dot co.uk @ 2023-12-07 21:51 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112908
Bug ID: 112908
Summary: __reference_{converts,constructs}_from_temporary
checks for move constructor when binding prvalue to
reference of the same type
Product: gcc
Version: 14.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: mital at mitalashok dot co.uk
Target Milestone: ---
The following compiles on trunk:
struct NonMovable {
NonMovable() = default;
NonMovable(NonMovable&&) = delete;
};
static_assert( __reference_converts_from_temporary(int&&, int));
static_assert(!__reference_converts_from_temporary(NonMovable&&,
NonMovable));
static_assert( __reference_constructs_from_temporary(int&&, int));
static_assert(!__reference_constructs_from_temporary(NonMovable&&,
NonMovable));
When the NonMovable assertions should fail because there *is* a temporary being
bound to a reference (in exactly the same way as the int case).
We can observe it instantiating constructors that shouldn't be too:
template<typename T>
struct S {
template<typename U = T>
S(const S&&) noexcept(U()) {}
};
static_assert(__reference_converts_from_temporary(const S<bool>&&, const
S<bool>));
static_assert(__reference_converts_from_temporary(const S<void*>&&, const
S<void*>));
Which complains about a conversion from void* to bool even though constructors
shouldn't be looked at.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c++/112908] __reference_{converts,constructs}_from_temporary checks for move constructor when binding prvalue to reference of the same type
2023-12-07 21:51 [Bug c++/112908] New: __reference_{converts,constructs}_from_temporary checks for move constructor when binding prvalue to reference of the same type mital at mitalashok dot co.uk
@ 2023-12-20 16:13 ` ppalka at gcc dot gnu.org
2023-12-20 16:27 ` mpolacek at gcc dot gnu.org
1 sibling, 0 replies; 3+ messages in thread
From: ppalka at gcc dot gnu.org @ 2023-12-20 16:13 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112908
Patrick Palka <ppalka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed| |2023-12-20
Alias| |lwg3819
Ever confirmed|0 |1
Status|UNCONFIRMED |NEW
CC| |ppalka at gcc dot gnu.org
--- Comment #1 from Patrick Palka <ppalka at gcc dot gnu.org> ---
This seems to be https://cplusplus.github.io/LWG/issue3819
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c++/112908] __reference_{converts,constructs}_from_temporary checks for move constructor when binding prvalue to reference of the same type
2023-12-07 21:51 [Bug c++/112908] New: __reference_{converts,constructs}_from_temporary checks for move constructor when binding prvalue to reference of the same type mital at mitalashok dot co.uk
2023-12-20 16:13 ` [Bug c++/112908] " ppalka at gcc dot gnu.org
@ 2023-12-20 16:27 ` mpolacek at gcc dot gnu.org
1 sibling, 0 replies; 3+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2023-12-20 16:27 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112908
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at gcc dot gnu.org |mpolacek at gcc dot gnu.org
Status|NEW |ASSIGNED
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-12-20 16:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-07 21:51 [Bug c++/112908] New: __reference_{converts,constructs}_from_temporary checks for move constructor when binding prvalue to reference of the same type mital at mitalashok dot co.uk
2023-12-20 16:13 ` [Bug c++/112908] " ppalka at gcc dot gnu.org
2023-12-20 16:27 ` mpolacek 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).