This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/71100] New: [6.1 regression] Internal compiler error while calling a pointer to member function that throws


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

            Bug ID: 71100
           Summary: [6.1 regression] Internal compiler error while calling
                    a pointer to member function that throws
           Product: gcc
           Version: 6.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ogoffart at kde dot org
  Target Milestone: ---

This code crashes GCC 6.1 when optimisations are enabled:

-----------------------------------------------------------
struct Destr
{ ~Destr(); };

struct XX
{
    Destr func() {
        throw "throw";
        return {};
    }
};

inline void call(Destr (XX::*f)(), XX *o)
{
    (o->*f)();
}

void f(XX *o) {
    call(&XX::func, o);
}
-----------------------------------------------------------


Live demo:
http://melpon.org/wandbox/permlink/GyM44dSdEnvqqmZN

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]