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]

[C++] static_cast does not check for accessibility



The following should be rejected but gcc-2.96 current CVS accepts it.

	class A {];
	class B : A {};
	
	int main()
	{
		B b;
		static_cast<A*>(&b);	// ERROR
	}

See 5.2.9/2 and 4.10/3.

-- Gaby


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