OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [obj-c++.dg/] [method-21.mm] - Blame information for rev 703

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 703 jeremybenn
/* Test for spurious "may or may not return a value" warnings.  */
2
/* { dg-do compile } */
3
/* { dg-options "-Wreturn-type -Wextra" } */
4
 
5
#include "../objc-obj-c++-shared/TestsuiteObject.h"
6
 
7
@interface Foo: TestsuiteObject
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 [TestsuiteObject 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

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.