This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/17177] Can not explicitly call protected superclass constructor in method
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Aug 2004 22:45:45 -0000
- Subject: [Bug c++/17177] Can not explicitly call protected superclass constructor in method
- References: <20040824204542.17177.jjamison@cs.berkeley.edu>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From bangerth at dealii dot org 2004-08-24 22:45 -------
Protected members are only accessible in derived classes when called through this->,
not for any object. What you try is equivalent to
----------------
class C
{
protected:
void foo();
};
class D : public C
{
void bar ()
{
C c;
c.foo();
}
};
--------------------------------
which fails for the same reason.
W.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17177