Mercurial > hg > CbC > CbC_gcc
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 |
rev | line source |
---|---|
111 | 1 // { dg-do compile } |
2 // { dg-options "-ansi -pedantic-errors -Wold-style-cast" } | |
3 | |
4 // Copyright (C) 2001 Free Software Foundation, Inc. | |
5 // Contributed by Nathan Sidwell 26 Dec 2001 <nathan@codesourcery.com> | |
6 | |
7 // PR 5089. old style cast to void should be permitted (think assert) | |
8 | |
9 void foo () | |
10 { | |
11 int i; | |
12 float f = (float)i; // { dg-warning "use of old-style cast" } | |
13 | |
14 (void)i; | |
15 } | |
16 |