public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/85723] [C++17][DR 1496] __is_trivial intrinsic fails with no trivial non-deleted default c'tor
       [not found] <bug-85723-4@http.gcc.gnu.org/bugzilla/>
@ 2024-06-18 12:15 ` redi at gcc dot gnu.org
  2024-06-18 16:54 ` pinskia at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 5+ messages in thread
From: redi at gcc dot gnu.org @ 2024-06-18 12:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
And again, causing PR 115522

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

* [Bug c++/85723] [C++17][DR 1496] __is_trivial intrinsic fails with no trivial non-deleted default c'tor
       [not found] <bug-85723-4@http.gcc.gnu.org/bugzilla/>
  2024-06-18 12:15 ` [Bug c++/85723] [C++17][DR 1496] __is_trivial intrinsic fails with no trivial non-deleted default c'tor redi at gcc dot gnu.org
@ 2024-06-18 16:54 ` pinskia at gcc dot gnu.org
  2024-06-18 17:06 ` mpolacek at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-06-18 16:54 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #3)
> And again, causing PR 115522

oh and clang has not implemented this DR either which made me think that was
more of a libstdc++ issue :).

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

* [Bug c++/85723] [C++17][DR 1496] __is_trivial intrinsic fails with no trivial non-deleted default c'tor
       [not found] <bug-85723-4@http.gcc.gnu.org/bugzilla/>
  2024-06-18 12:15 ` [Bug c++/85723] [C++17][DR 1496] __is_trivial intrinsic fails with no trivial non-deleted default c'tor redi at gcc dot gnu.org
  2024-06-18 16:54 ` pinskia at gcc dot gnu.org
@ 2024-06-18 17:06 ` mpolacek at gcc dot gnu.org
  2024-06-19 13:56 ` mpolacek at gcc dot gnu.org
  2024-06-21  9:15 ` cvs-commit at gcc dot gnu.org
  4 siblings, 0 replies; 5+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2024-06-18 17:06 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|                            |mpolacek at gcc dot gnu.org
           Assignee|unassigned at gcc dot gnu.org      |mpolacek at gcc dot gnu.org

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

* [Bug c++/85723] [C++17][DR 1496] __is_trivial intrinsic fails with no trivial non-deleted default c'tor
       [not found] <bug-85723-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2024-06-18 17:06 ` mpolacek at gcc dot gnu.org
@ 2024-06-19 13:56 ` mpolacek at gcc dot gnu.org
  2024-06-21  9:15 ` cvs-commit at gcc dot gnu.org
  4 siblings, 0 replies; 5+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2024-06-19 13:56 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch

--- Comment #5 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Patch posted:
https://gcc.gnu.org/pipermail/gcc-patches/2024-June/655124.html

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

* [Bug c++/85723] [C++17][DR 1496] __is_trivial intrinsic fails with no trivial non-deleted default c'tor
       [not found] <bug-85723-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2024-06-19 13:56 ` mpolacek at gcc dot gnu.org
@ 2024-06-21  9:15 ` cvs-commit at gcc dot gnu.org
  4 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-06-21  9:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:

https://gcc.gnu.org/g:510ce5eed69ee1bea9c2c696fe3b2301e16d1486

commit r15-1533-g510ce5eed69ee1bea9c2c696fe3b2301e16d1486
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Tue Jun 18 13:27:02 2024 +0100

    libstdc++: Fix std::to_array for trivial-ish types [PR115522]

    Due to PR c++/85723 the std::is_trivial trait is true for types with a
    deleted default constructor, so the use of std::is_trivial in
    std::to_array is not sufficient to ensure the type can be trivially
    default constructed then filled using memcpy.

    I also forgot that a type with a deleted assignment operator can still
    be trivial, so we also need to check that it's assignable because the
    is_constant_evaluated() path can't use memcpy.

    Replace the uses of std::is_trivial with std::is_trivially_copyable
    (needed for memcpy), std::is_trivially_default_constructible (needed so
    that the default construction is valid and does no work) and
    std::is_copy_assignable (needed for the constant evaluation case).

    libstdc++-v3/ChangeLog:

            PR libstdc++/115522
            * include/std/array (to_array): Workaround the fact that
            std::is_trivial is not sufficient to check that a type is
            trivially default constructible and assignable.
            * testsuite/23_containers/array/creation/115522.cc: New test.

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

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

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-85723-4@http.gcc.gnu.org/bugzilla/>
2024-06-18 12:15 ` [Bug c++/85723] [C++17][DR 1496] __is_trivial intrinsic fails with no trivial non-deleted default c'tor redi at gcc dot gnu.org
2024-06-18 16:54 ` pinskia at gcc dot gnu.org
2024-06-18 17:06 ` mpolacek at gcc dot gnu.org
2024-06-19 13:56 ` mpolacek at gcc dot gnu.org
2024-06-21  9:15 ` cvs-commit 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).