https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80959

--- Comment #5 from Martin Liška <marxin at gcc dot gnu.org> ---
Can be also simulated with ObjC:

$ cat /tmp/objc.m
volatile int i;

int
foo (void)
{
  @try {
    switch (i)
      {
      case 1:
        switch (i)
          {
          default:
            return 0;
          }
        break;
      default:
        return 0;
      }
  }
  @finally {
    i = 2;
  }
}

$ gcc /tmp/objc.m -fobjc-exceptions -c -Wall 
/tmp/objc.m: In function ‘foo’:
/tmp/objc.m:23:1: warning: control reaches end of non-void function
[-Wreturn-type]
 }
 ^

But as the function decide_copy_try_finally depends on optimization level:

$ gcc /tmp/objc.m -fobjc-exceptions -c -Wall -O1
[nothing]

Reply via email to