PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / obj-c++.dg / method-21.mm
blobd9332beb073347860a7cf5c38d85b9cdaeae5f32
1 /* Test for spurious "may or may not return a value" warnings.  */
2 /* { dg-do compile } */
3 /* { dg-options "-Wreturn-type -Wextra" } */
5 #include "../objc-obj-c++-shared/TestsuiteObject.h"
7 @interface Foo: TestsuiteObject
8 - (id) meth1;
9 - (void) meth2;
10 @end
12 extern int bar;
14 @implementation Foo
15 - (id) meth1 {
16   if (bar)
17     return [TestsuiteObject new];
18   return; /* { dg-error "return.statement with no value" } */
20 - (void) meth2 {
21   if (!bar)
22     return;
23   bar = 0;
25 @end