public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/59238] New: Dynamic allocating a list-initialized object of a type with private destructor fails.
@ 2013-11-21 22:00 cassio.neri at gmail dot com
  2013-11-22 13:22 ` [Bug c++/59238] " redi at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: cassio.neri at gmail dot com @ 2013-11-21 22:00 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 59238
           Summary: Dynamic allocating a list-initialized object of a type
                    with private destructor fails.
           Product: gcc
           Version: 4.8.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: cassio.neri at gmail dot com

Consider:

class foo {
  ~foo() {}
};

int main() { 
  new foo;   // OK
  new foo(); // OK
  new foo{}; // error: 'foo::~foo()' is private
}

The last line shouldn't fail to compile since the destructor is not invoked.

FWIW, it compiles fine with clang. It also compiles fine with gcc 4.9.0
20131109 if foo has a user declared default constructor.


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

end of thread, other threads:[~2021-12-04 13:28 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-21 22:00 [Bug c++/59238] New: Dynamic allocating a list-initialized object of a type with private destructor fails cassio.neri at gmail dot com
2013-11-22 13:22 ` [Bug c++/59238] " redi at gcc dot gnu.org
2020-12-07 11:09 ` davveston at gmail dot com
2020-12-07 11:18 ` redi at gcc dot gnu.org
2020-12-07 11:57 ` jakub at gcc dot gnu.org
2020-12-07 12:07 ` jakub at gcc dot gnu.org
2020-12-09  5:36 ` cvs-commit at gcc dot gnu.org
2020-12-10 18:33 ` jakub at gcc dot gnu.org
2021-12-04 13:23 ` pinskia at gcc dot gnu.org
2021-12-04 13:28 ` 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).