public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/96614] New: constexpr deletion failure through pointer to base with virtual base class
@ 2020-08-14  9:42 pkeir at outlook dot com
  2020-08-17  6:45 ` [Bug c++/96614] " marxin at gcc dot gnu.org
  2021-08-17  5:56 ` pinskia at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: pkeir at outlook dot com @ 2020-08-14  9:42 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 96614
           Summary: constexpr deletion failure through pointer to base
                    with virtual base class
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pkeir at outlook dot com
  Target Milestone: ---

Created attachment 49062
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49062&action=edit
A C++ file containing the code described.

The C++20 code below (also attached) fails to compile with GCC trunk.

struct FooBase {
  constexpr virtual ~FooBase() {}
};

struct Foo : public FooBase {};

constexpr bool test()
{
  FooBase* pb = new Foo;
  delete pb;

  return true;
}

int main(int argc, char *argv[])
{
  static_assert(test());
  test(); // no problem

  return 0;
}

The error is invoked by the `static_assert` expression, and relates to the call
to `delete pb`. It states:

virtual constexpr Foo::~Foo()’ used before its definition

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

* [Bug c++/96614] constexpr deletion failure through pointer to base with virtual base class
  2020-08-14  9:42 [Bug c++/96614] New: constexpr deletion failure through pointer to base with virtual base class pkeir at outlook dot com
@ 2020-08-17  6:45 ` marxin at gcc dot gnu.org
  2021-08-17  5:56 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-08-17  6:45 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2020-08-17
           Keywords|                            |rejects-valid
             Status|UNCONFIRMED                 |NEW
                 CC|                            |jason at gcc dot gnu.org,
                   |                            |marxin at gcc dot gnu.org,
                   |                            |mpolacek at gcc dot gnu.org,
                   |                            |ppalka at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Confirmed.

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

* [Bug c++/96614] constexpr deletion failure through pointer to base with virtual base class
  2020-08-14  9:42 [Bug c++/96614] New: constexpr deletion failure through pointer to base with virtual base class pkeir at outlook dot com
  2020-08-17  6:45 ` [Bug c++/96614] " marxin at gcc dot gnu.org
@ 2021-08-17  5:56 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-17  5:56 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
             Status|NEW                         |RESOLVED

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Dup of bug 93413.

*** This bug has been marked as a duplicate of bug 93413 ***

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

end of thread, other threads:[~2021-08-17  5:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-14  9:42 [Bug c++/96614] New: constexpr deletion failure through pointer to base with virtual base class pkeir at outlook dot com
2020-08-17  6:45 ` [Bug c++/96614] " marxin at gcc dot gnu.org
2021-08-17  5:56 ` 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).