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++/66847] Derived class calling protected base ctor using C++11 {brace} init = spurious access denied error


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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|=x86_64-w64-mingw32         |
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-07-22
               Host|=x86_64-w64-mingw32         |
     Ever confirmed|0                           |1
      Known to fail|                            |5.1.1, 6.0
              Build|4.9.2                       |

--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> ---
This seems different enough to PR 63151 and PR 66617 to warrant it's own PR.


Reduced:

struct VBase { };

class Base
        : public virtual VBase
{
protected:
        Base(int, int)
        {}
};

struct Derived : Base
{
        Derived()
        :
                Base{1, 1}
        {}
};

Derived myDerived;



x.cc: In constructor âDerived::Derived()â:
x.cc:15:12: error: âBase::Base(int, int)â is protected within this context
   Base{1, 1}
            ^
x.cc:7:2: note: declared protected here
  Base(int, int)
  ^

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