public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/51452] New: has_nothrow_.*constructor bugs
@ 2011-12-07 16:56 dave@boost-consulting.com
  2011-12-07 17:17 ` [Bug libstdc++/51452] " redi at gcc dot gnu.org
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: dave@boost-consulting.com @ 2011-12-07 16:56 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51452

             Bug #: 51452
           Summary: has_nothrow_.*constructor bugs
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: dave@boost-consulting.com


The traits that detect nothrow constructibility are buggy because they are
influenced by whether the object has a nothrow dtor; destruction is invoked at
the end of evaluation of the full expression in the noexcept( ... ) operator. 
They all use the pattern of constructing a temporary inside noexcept, whereas
they should be using placement new:


  struct X
  {
      X() noexcept;
      ~X();
  };

  static_assert( noexcept( X() ), "fails because of ~X" );
  static_assert( noexcept(new (nullptr) X()), "works" );


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

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

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-07 16:56 [Bug libstdc++/51452] New: has_nothrow_.*constructor bugs dave@boost-consulting.com
2011-12-07 17:17 ` [Bug libstdc++/51452] " redi at gcc dot gnu.org
2011-12-07 17:21 ` paolo.carlini at oracle dot com
2011-12-07 17:33 ` paolo.carlini at oracle dot com
2011-12-07 17:38 ` redi at gcc dot gnu.org
2011-12-07 18:41 ` dave@boost-consulting.com
2011-12-07 19:04 ` redi at gcc dot gnu.org
2011-12-09 16:00 ` daniel.kruegler at googlemail dot com
2011-12-09 16:03 ` redi at gcc dot gnu.org
2011-12-09 16:04 ` paolo.carlini at oracle dot com
2011-12-09 18:13 ` dave at boostpro dot com
2011-12-09 18:28 ` redi at gcc dot gnu.org
2011-12-09 19:11 ` paolo.carlini at oracle dot com
2011-12-09 19:46 ` redi at gcc dot gnu.org
2012-08-12 18:15 ` [Bug libstdc++/51452] [DR 2116] " redi at gcc dot gnu.org
2012-09-26 23:14 ` paolo.carlini at oracle dot com
2013-02-04  7:29 ` antoshkka at gmail dot com
2021-09-06 15:53 ` [Bug libstdc++/51452] [DR 2116] is_nothrow_.*constructible bugs redi at gcc dot gnu.org
2024-06-20 14:45 ` 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).