annotate gcc/testsuite/g++.dg/warn/oldcast1.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 // { dg-do compile }
kono
parents:
diff changeset
2 // { dg-options "-ansi -pedantic-errors -Wold-style-cast" }
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 // Copyright (C) 2001 Free Software Foundation, Inc.
kono
parents:
diff changeset
5 // Contributed by Nathan Sidwell 26 Dec 2001 <nathan@codesourcery.com>
kono
parents:
diff changeset
6
kono
parents:
diff changeset
7 // PR 5089. old style cast to void should be permitted (think assert)
kono
parents:
diff changeset
8
kono
parents:
diff changeset
9 void foo ()
kono
parents:
diff changeset
10 {
kono
parents:
diff changeset
11 int i;
kono
parents:
diff changeset
12 float f = (float)i; // { dg-warning "use of old-style cast" }
kono
parents:
diff changeset
13
kono
parents:
diff changeset
14 (void)i;
kono
parents:
diff changeset
15 }
kono
parents:
diff changeset
16