comparison gcc/testsuite/gcc.dg/pr29521-2.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
comparison
equal deleted inserted replaced
68:561a7518be6b 111:04ced10e8804
1 /* PR 29521 : warning for return with expression in function returning void */
2 /* { dg-do compile } */
3 /* { dg-options "-pedantic-errors" } */
4
5 void func (void) { }
6
7 void func2 (void)
8 {
9 return func (); /* { dg-error "ISO C forbids 'return' with expression" } */
10 }
11
12 void func3 (void)
13 {
14 return 1; /* { dg-error "'return' with a value" } */
15 }