public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/111426] New: [11/12/13/14 Regression] "error: use of deleted function" printed twice
@ 2023-09-15 13:38 mpolacek at gcc dot gnu.org
  2023-09-15 13:39 ` [Bug c++/111426] " mpolacek at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2023-09-15 13:38 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 111426
           Summary: [11/12/13/14 Regression] "error: use of deleted
                    function" printed twice
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mpolacek at gcc dot gnu.org
  Target Milestone: ---

An inaccessible destructor prevents derivation:

struct X {
  ~X() = delete;
};

class D : public X { };
D d;

but we complain twice:

$ ./cc1plus -quiet q.C
q.C:6:3: error: use of deleted function ‘D::D()’
    6 | D d;
      |   ^
q.C:5:7: note: ‘D::D()’ is implicitly deleted because the default definition
would be ill-formed:
    5 | class D : public X { };
      |       ^
q.C:5:7: error: use of deleted function ‘X::~X()’
q.C:2:3: note: declared here
    2 |   ~X() = delete;
      |   ^
q.C:6:3: error: use of deleted function ‘D::~D()’
    6 | D d;
      |   ^
q.C:5:7: note: ‘D::~D()’ is implicitly deleted because the default definition
would be ill-formed:
    5 | class D : public X { };
      |       ^
q.C:5:7: error: use of deleted function ‘X::~X()’
q.C:2:3: note: declared here
    2 |   ~X() = delete;
      |   ^

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

end of thread, other threads:[~2024-03-27 15:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-15 13:38 [Bug c++/111426] New: [11/12/13/14 Regression] "error: use of deleted function" printed twice mpolacek at gcc dot gnu.org
2023-09-15 13:39 ` [Bug c++/111426] " mpolacek at gcc dot gnu.org
2024-03-07 22:29 ` law at gcc dot gnu.org
2024-03-27 15:05 ` jakub at gcc dot gnu.org
2024-03-27 15:47 ` mpolacek 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).