public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/98515] New: Possible regression causing "is protected within this context" error
@ 2021-01-04 16:49 belegdol at gmail dot com
  2021-01-04 16:50 ` [Bug c++/98515] " belegdol at gmail dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: belegdol at gmail dot com @ 2021-01-04 16:49 UTC (permalink / raw)
  To: 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<int a> class B : public A {
public:
    using A::A;
};

template<int a, int b> class C : public B<a> {
public:
    using B<a>::B;

    void g();
};

template<int a, int b> void C<a, b>::g()
{
    A::var0++;
}

template class C<0, 0>;

While this works:

class A {
public:
    A() = default;

protected:
    int var0 = 0;
};

template<int a> class B : public A {
public:
    using A::A;
};

template<int a, int b> class C : public B<a> {
public:
    using B<a>::B;

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

template class C<0, 0>;

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

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

end of thread, other threads:[~2021-01-08 15:19 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-04 16:49 [Bug c++/98515] New: Possible regression causing "is protected within this context" error belegdol at gmail dot com
2021-01-04 16:50 ` [Bug c++/98515] " belegdol at gmail dot com
2021-01-04 16:50 ` belegdol at gmail dot com
2021-01-04 16:53 ` belegdol at gmail dot com
2021-01-04 20:19 ` [Bug c++/98515] [11 Regression] " mpolacek at gcc dot gnu.org
2021-01-05 18:45 ` ppalka at gcc dot gnu.org
2021-01-08 15:17 ` cvs-commit at gcc dot gnu.org
2021-01-08 15:19 ` ppalka 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).