public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/94033] [10 Regression] is_trivially_copy_constructible<> fails with compiler error on complicated object with private default constructor Date: Fri, 11 Sep 2020 10:53:02 +0000 [thread overview] Message-ID: <bug-94033-4-2SXm1hF5cN@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-94033-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94033 --- Comment #21 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-8 branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>: https://gcc.gnu.org/g:1521433e2b6bff583b227fe391fe9dcf02f6000e commit r8-10445-g1521433e2b6bff583b227fe391fe9dcf02f6000e Author: Jonathan Wakely <jwakely@redhat.com> Date: Wed Mar 18 23:19:12 2020 +0000 libstdc++: Fix is_trivially_constructible (PR 94033) This attempts to make is_nothrow_constructible more robust (and efficient to compile) by not depending on is_constructible. Instead the __is_constructible intrinsic is used directly. The helper class __is_nt_constructible_impl which checks whether the construction is non-throwing now takes a bool template parameter that is substituted by the result of the instrinsic. This fixes the reported bug by not using the already-instantiated (and incorrect) value of std::is_constructible. I don't think it really fixes the problem in general, because std::is_nothrow_constructible itself could already have been instantiated in a context where it gives the wrong result. A proper fix needs to be done in the compiler. Backported to the gcc-8 and gcc-9 branches to fix PR 96999. PR libstdc++/94033 * include/std/type_traits (__is_nt_default_constructible_atom): Remove. (__is_nt_default_constructible_impl): Remove. (__is_nothrow_default_constructible_impl): Remove. (__is_nt_constructible_impl): Add bool template parameter. Adjust partial specializations. (__is_nothrow_constructible_impl): Replace class template with alias template. (is_nothrow_default_constructible): Derive from alias template __is_nothrow_constructible_impl instead of __is_nothrow_default_constructible_impl. * testsuite/20_util/is_nothrow_constructible/94003.cc: New test. (cherry picked from commit b3341826531e80e02f194460b4fbe1b0541c0463)
next prev parent reply other threads:[~2020-09-11 10:53 UTC|newest] Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top [not found] <bug-94033-4@http.gcc.gnu.org/bugzilla/> 2020-03-07 19:54 ` [Bug libstdc++/94033] " rafael at espindo dot la 2020-03-11 12:01 ` [Bug libstdc++/94033] [10 Regression] " redi at gcc dot gnu.org 2020-03-11 12:04 ` redi at gcc dot gnu.org 2020-03-12 13:59 ` avi@cloudius-systems.com 2020-03-12 14:10 ` redi at gcc dot gnu.org 2020-03-12 14:15 ` avi@cloudius-systems.com 2020-03-12 14:20 ` redi at gcc dot gnu.org 2020-03-12 14:57 ` redi at gcc dot gnu.org 2020-03-12 16:38 ` redi at gcc dot gnu.org 2020-03-16 14:54 ` avi@cloudius-systems.com 2020-03-16 15:38 ` redi at gcc dot gnu.org 2020-03-16 16:07 ` redi at gcc dot gnu.org 2020-03-17 17:48 ` avi@cloudius-systems.com 2020-03-17 18:14 ` redi at gcc dot gnu.org 2020-03-18 23:20 ` cvs-commit at gcc dot gnu.org 2020-03-18 23:21 ` redi at gcc dot gnu.org 2020-09-11 10:09 ` cvs-commit at gcc dot gnu.org 2020-09-11 10:53 ` cvs-commit at gcc dot gnu.org [this message] 2021-09-30 15:01 ` ppalka at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-94033-4-2SXm1hF5cN@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).