[Bug c++/95949] mame build succeeds with -O3 but fails with -O2 and all -O3 flags added manually

2021-12-17 Thread belegdol at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95949

--- Comment #11 from Julian Sikorski  ---
I can still reproduce this with mame master
(0b418d65bae66baa9f334c6daa6dcb4148909f7f) and mingw-w64-x86_64-gcc 11.2.0-5.

[Bug c++/98515] Possible regression causing "is protected within this context" error

2021-01-04 Thread belegdol at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98515

--- Comment #3 from Julian Sikorski  ---
The initial comment meant to say: This fails with gcc-11 but works on gcc-10.2.

[Bug c++/98515] Possible regression causing "is protected within this context" error

2021-01-04 Thread belegdol at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98515

--- Comment #2 from Julian Sikorski  ---
Created attachment 49878
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49878=edit
failing test case

[Bug c++/98515] Possible regression causing "is protected within this context" error

2021-01-04 Thread belegdol at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98515

--- Comment #1 from Julian Sikorski  ---
Created attachment 49877
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49877=edit
compiling test case

[Bug c++/98515] New: Possible regression causing "is protected within this context" error

2021-01-04 Thread belegdol at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98515

Bug ID: 98515
   Summary: Possible regression causing "is protected within this
context" error
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: belegdol at gmail dot com
  Target Milestone: ---

mame-0.227 has failed to compile with gcc-11 in Fedora 34 [1]
(gcc-11.0.0-0.11.fc34). mame developers have kindly provided a minimal test
case. This fails with gcc-11 but works on 

class A {
public:
A() = default;

protected:
int var0 = 0;
};

template class B : public A {
public:
using A::A;
};

template class C : public B {
public:
using B::B;

void g();
};

template void C::g()
{
A::var0++;
}

template class C<0, 0>;

While this works:

class A {
public:
A() = default;

protected:
int var0 = 0;
};

template class B : public A {
public:
using A::A;
};

template class C : public B {
public:
using B::B;

void g() { A::var0++; }
};

template class C<0, 0>;

[1] https://github.com/mamedev/mame/issues/7616