2 // { dg-options "-Wall" }
4 // Copyright (C) 2003 Free Software Foundation, Inc.
5 // Contributed by Nathan Sidwell 2 Sep 2003 <nathan@codesourcery.com>
39 operator int () const;
48 template<int I> void Foo (X &x)
78 dynamic_cast<Y &> (x);
79 reinterpret_cast<int> (x.Foo ()); // { dg-error "invalid cast" }
80 const_cast<X &> (x.Foo ()); // { dg-warning "not used" }
82 reinterpret_cast<int *> (&x);// { dg-warning "no effect" "" }
83 const_cast<X &> (x); // { dg-warning "no effect" "" }
84 sizeof (x++); // { dg-warning "no effect" "" }
85 __alignof__ (x++); // { dg-warning "no effect" "" }
88 template void Foo<4> (X&); // { dg-warning "instantiated" }