repo.or.cz
/
netbsd-mini2440.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
history
|
raw
|
HEAD
Sync usage with man page.
[netbsd-mini2440.git]
/
gnu
/
dist
/
gcc4
/
gcc
/
testsuite
/
obj-c++.dg
/
method-21.mm
blob
94291a5a106e43c4f2ee187e1881c3d53f42d768
1
/* Test for spurious "may or may not return a value" warnings. */
2
/* { dg-do compile } */
3
/* { dg-options "-Wextra" } */
4
5
#include <objc/Object.h>
6
7
@interface Foo: Object
8
- (id) meth1;
9
- (void) meth2;
10
@end
11
12
extern int bar;
13
14
@implementation Foo
15
- (id) meth1 {
16
if (bar)
17
return [Object new];
18
return; /* { dg-error "return.statement with no value" } */
19
}
20
- (void) meth2 {
21
if (!bar)
22
return;
23
bar = 0;
24
}
25
@end