public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/97285] New: Interaction between no_unique_address and has_unique_object_representations
@ 2020-10-04 14:38 barry.revzin at gmail dot com
2020-10-05 16:11 ` [Bug c++/97285] " mpolacek at gcc dot gnu.org
2021-11-27 23:05 ` pinskia at gcc dot gnu.org
0 siblings, 2 replies; 3+ messages in thread
From: barry.revzin at gmail dot com @ 2020-10-04 14:38 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97285
Bug ID: 97285
Summary: Interaction between no_unique_address and
has_unique_object_representations
Product: gcc
Version: 10.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: barry.revzin at gmail dot com
Target Milestone: ---
>From StackOverflow (https://stackoverflow.com/q/64195712/2069064):
#include <type_traits>
struct Empty {};
struct A : public Empty {
int x;
};
struct B {
[[no_unique_address]] Empty e;
int x;
};
static_assert (sizeof(A) == sizeof(int)); // ok
static_assert (sizeof(B) == sizeof(int)); // ok
static_assert(std::has_unique_object_representations_v<A>); // ok
static_assert(std::has_unique_object_representations_v<B>); // error
gcc does not consider B to have unique object representations, but it should
here.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c++/97285] Interaction between no_unique_address and has_unique_object_representations
2020-10-04 14:38 [Bug c++/97285] New: Interaction between no_unique_address and has_unique_object_representations barry.revzin at gmail dot com
@ 2020-10-05 16:11 ` mpolacek at gcc dot gnu.org
2021-11-27 23:05 ` pinskia at gcc dot gnu.org
1 sibling, 0 replies; 3+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-10-05 16:11 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97285
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mpolacek at gcc dot gnu.org
Status|UNCONFIRMED |NEW
Last reconfirmed| |2020-10-05
Ever confirmed|0 |1
--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Sounds plausible.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c++/97285] Interaction between no_unique_address and has_unique_object_representations
2020-10-04 14:38 [Bug c++/97285] New: Interaction between no_unique_address and has_unique_object_representations barry.revzin at gmail dot com
2020-10-05 16:11 ` [Bug c++/97285] " mpolacek at gcc dot gnu.org
@ 2021-11-27 23:05 ` pinskia at gcc dot gnu.org
1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-11-27 23:05 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97285
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
clang has fixed this on the their trunk.
That is std::has_unique_object_representations_v<B> is true there.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-11-27 23:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-04 14:38 [Bug c++/97285] New: Interaction between no_unique_address and has_unique_object_representations barry.revzin at gmail dot com
2020-10-05 16:11 ` [Bug c++/97285] " mpolacek at gcc dot gnu.org
2021-11-27 23:05 ` 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).