OSDN Git Service

Add NIOS2 support. Code from SourceyG++.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.old-deja / g++.other / cast2.C
1 // { dg-do assemble  }
2 // Origin: Mark Mitchell <mark@codesourcery.com>
3
4 struct A {
5 };
6
7 int main()
8 {
9   A a;
10   typedef void (A::*F)();
11   F p;
12
13   const_cast<const A>(a); // { dg-error "" } const_cast requires pointer/ref types
14   const_cast<F>(p); // { dg-error "" } const_cast requires pointer/ref types
15   const_cast<int (*)()>(&main); // { dg-error "" } function type in const_cast
16   const_cast<int (&)()>(main); // { dg-error "" } function type in const_cast
17 }