public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/115480] New: Difference between trivial copyability of std::pair under Clang in C++23
@ 2024-06-13 18:09 ldionne.2 at gmail dot com
  2024-06-13 18:15 ` [Bug c++/115480] " pinskia at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: ldionne.2 at gmail dot com @ 2024-06-13 18:09 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115480

            Bug ID: 115480
           Summary: Difference between trivial copyability of std::pair
                    under Clang in C++23
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ldionne.2 at gmail dot com
  Target Milestone: ---

Let's say Foo is a trivially copyable type without an assignment operator.

In C++23, std::pair<Foo, int> is currently trivially copyable using Clang trunk
and GCC trunk. However, it wasn't trivially copyable in the Clang 15 era.

Godbolt: https://godbolt.org/z/TKK7qhhbM

I don't know whether y'all care about this, but we ran into this while
investigating some libc++ stuff and we thought we'd point it out in case it was
considered an ABI break introduced ~2 years ago.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/115480] Difference between trivial copyability of std::pair under Clang in C++23
  2024-06-13 18:09 [Bug libstdc++/115480] New: Difference between trivial copyability of std::pair under Clang in C++23 ldionne.2 at gmail dot com
@ 2024-06-13 18:15 ` pinskia at gcc dot gnu.org
  2024-06-13 18:20 ` pinskia at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-06-13 18:15 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115480

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---

  template<typename _Tp>
    struct is_trivially_copyable
    : public integral_constant<bool, __is_trivially_copyable(_Tp)>


Well it is clang front-end issue though it looks like GCC had a similar issue
too.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/115480] Difference between trivial copyability of std::pair under Clang in C++23
  2024-06-13 18:09 [Bug libstdc++/115480] New: Difference between trivial copyability of std::pair under Clang in C++23 ldionne.2 at gmail dot com
  2024-06-13 18:15 ` [Bug c++/115480] " pinskia at gcc dot gnu.org
@ 2024-06-13 18:20 ` pinskia at gcc dot gnu.org
  2024-06-13 18:24 ` pinskia at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-06-13 18:20 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115480

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
#include <type_traits>
#include <utility>

struct trivially_copyable_no_assignment {
  int arr[4];
  trivially_copyable_no_assignment& operator=(const
trivially_copyable_no_assignment&) = delete;
};

static_assert(std::is_trivially_copyable<std::pair<trivially_copyable_no_assignment,
int> >::value, "");

int main() { }

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/115480] Difference between trivial copyability of std::pair under Clang in C++23
  2024-06-13 18:09 [Bug libstdc++/115480] New: Difference between trivial copyability of std::pair under Clang in C++23 ldionne.2 at gmail dot com
  2024-06-13 18:15 ` [Bug c++/115480] " pinskia at gcc dot gnu.org
  2024-06-13 18:20 ` pinskia at gcc dot gnu.org
@ 2024-06-13 18:24 ` pinskia at gcc dot gnu.org
  2024-06-13 18:28 ` pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-06-13 18:24 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115480

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |WONTFIX
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Since this is a front-end issue for clang there is not much GCC/libstdc++
cannot do. Plus GCC 12.3 contained the fix that happened to be a bug in GCC 12
series so closing as won't fix.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/115480] Difference between trivial copyability of std::pair under Clang in C++23
  2024-06-13 18:09 [Bug libstdc++/115480] New: Difference between trivial copyability of std::pair under Clang in C++23 ldionne.2 at gmail dot com
                   ` (2 preceding siblings ...)
  2024-06-13 18:24 ` pinskia at gcc dot gnu.org
@ 2024-06-13 18:28 ` pinskia at gcc dot gnu.org
  2024-06-13 18:30 ` pinskia at gcc dot gnu.org
  2024-06-14 15:35 ` redi at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-06-13 18:28 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115480

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Note the change for GCC 12.3.0 that fix it was r12-8799-gaeba3e009b0abf .

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/115480] Difference between trivial copyability of std::pair under Clang in C++23
  2024-06-13 18:09 [Bug libstdc++/115480] New: Difference between trivial copyability of std::pair under Clang in C++23 ldionne.2 at gmail dot com
                   ` (3 preceding siblings ...)
  2024-06-13 18:28 ` pinskia at gcc dot gnu.org
@ 2024-06-13 18:30 ` pinskia at gcc dot gnu.org
  2024-06-14 15:35 ` redi at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-06-13 18:30 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115480

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #4)
> Note the change for GCC 12.3.0 that fix it was r12-8799-gaeba3e009b0abf .

https://gcc.gnu.org/pipermail/gcc-patches/2022-September/602548.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/115480] Difference between trivial copyability of std::pair under Clang in C++23
  2024-06-13 18:09 [Bug libstdc++/115480] New: Difference between trivial copyability of std::pair under Clang in C++23 ldionne.2 at gmail dot com
                   ` (4 preceding siblings ...)
  2024-06-13 18:30 ` pinskia at gcc dot gnu.org
@ 2024-06-14 15:35 ` redi at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: redi at gcc dot gnu.org @ 2024-06-14 15:35 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115480

--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Louis Dionne from comment #0)
> we thought we'd point it out in case it
> was considered an ABI break introduced ~2 years ago.

Thanks! It looks like this changed the ABI in C++20 mode, making it consistent
with the ABI in C++17 mode ... which is good (the other way around would be
more concerning). And C++20 mode isn't considered stable, so a change that only
affects C++20 mode isn't something we're going to worry about.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-06-14 15:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-13 18:09 [Bug libstdc++/115480] New: Difference between trivial copyability of std::pair under Clang in C++23 ldionne.2 at gmail dot com
2024-06-13 18:15 ` [Bug c++/115480] " pinskia at gcc dot gnu.org
2024-06-13 18:20 ` pinskia at gcc dot gnu.org
2024-06-13 18:24 ` pinskia at gcc dot gnu.org
2024-06-13 18:28 ` pinskia at gcc dot gnu.org
2024-06-13 18:30 ` pinskia at gcc dot gnu.org
2024-06-14 15:35 ` redi 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).