FSF GCC merge 02/23/03
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.other / cast2.C
blob80cf7dc1864b531aa30b95a292f23115c1232cb8
1 // Build don't link:
2 // Origin: Mark Mitchell <mark@codesourcery.com>
4 struct A {
5 };
7 int main()
9   A a;
10   typedef void (A::*F)();
11   F p;
13   const_cast<const A>(a); // ERROR - const_cast requires pointer/ref types
14   const_cast<F>(p); // ERROR - const_cast requires pointer/ref types
15   const_cast<int (*)()>(&main); // ERROR - function type in const_cast
16   const_cast<int (&)()>(main); // ERROR - function type in const_cast