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++/23849] inaccessible base in static_cast from template base type to non-template derived type


------- Additional Comments From bangerth at dealii dot org  2005-09-13 14:04 -------
Here's a slightly smaller version: 
----------------- 
struct A {}; 
struct B : private A {}; 
 
B *p = static_cast<B*>((A*)0); 
----------------- 
 
g/x> /home/bangerth/bin/gcc-3.2.3/bin/c++ -c x.cc 
g/x> /home/bangerth/bin/gcc-3.4*/bin/c++ -c x.cc 
x.cc:4: error: `A' is an inaccessible base of `B' 
 
The code is rejected at least since gcc3.3.4pre. I must admit that I don't 
know right away whether the code is legal -- icc for one accepts it -- though 
I could think of arguments why it shouldn't be. 
 
W. 

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23849


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