public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/108627] New: A new crash with using a simple class, inheritance and a function (version 2)
@ 2023-02-01 10:09 zakkariusr at gmail dot com
  2023-02-01 15:11 ` [Bug c++/108627] " mpolacek at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: zakkariusr at gmail dot com @ 2023-02-01 10:09 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 108627
           Summary: A new crash with using a simple class, inheritance and
                    a function (version 2)
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zakkariusr at gmail dot com
  Target Milestone: ---

The following code:

struct A {
    int i = 0;

    A() {}
    A(const A&) { i = 1; }
    int g() { return i; }
};

struct B : A {};

A u() { return A{}; }

int main() {
    return B{u()}.g();
}

causes a compiler crash on the current gcc(trunk) 13.0.1

I already reported the same thing:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108559
but applied a shorter version there for simplicity - that one was fixed but
this one here still crashes. Getting a member field (i) works now in this case
but not the member function (g())
Be ready for the version 3 :)

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

* [Bug c++/108627] A new crash with using a simple class, inheritance and a function (version 2)
  2023-02-01 10:09 [Bug c++/108627] New: A new crash with using a simple class, inheritance and a function (version 2) zakkariusr at gmail dot com
@ 2023-02-01 15:11 ` mpolacek at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2023-02-01 15:11 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
                 CC|                            |mpolacek at gcc dot gnu.org
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Fixed.

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

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

end of thread, other threads:[~2023-02-01 15:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-01 10:09 [Bug c++/108627] New: A new crash with using a simple class, inheritance and a function (version 2) zakkariusr at gmail dot com
2023-02-01 15:11 ` [Bug c++/108627] " 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).