FSF GCC merge 02/23/03
[official-gcc.git] / gcc / testsuite / g++.dg / warn / oldcast1.C
blob26c0a5c4d008667f3a015bededf045f9f0366ac1
1 // { dg-do compile }
2 // { dg-options "-ansi -pedantic-errors -Wold-style-cast" }
4 // Copyright (C) 2001 Free Software Foundation, Inc.
5 // Contributed by Nathan Sidwell 26 Dec 2001 <nathan@codesourcery.com>
7 // PR 5089. old style cast to void should be permitted (think assert)
9 void foo ()
11   int i;
12   float f = (float)i;  // { dg-warning "use of old-style cast" "" }
14   (void)i;