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++/17177] Can not explicitly call protected superclass constructor in method


------- 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


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