Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/obj-c++.dg/fobjc-exceptions-2.mm @ 144:8f4e72ab4e11
fix segmentation fault caused by nothing next cur_op to end
author | Takahiro SHIMIZU <anatofuz@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 23 Dec 2018 21:23:56 +0900 |
parents | 04ced10e8804 |
children |
line wrap: on
line source
/* Test that Objective-C exceptions cause an error with -fobjc-exceptions. */ /* { dg-do compile } */ @class Object; int dummy (int number, Object *o) { @synchronized (o) /* { dg-error ".-fobjc-exceptions. is required to enable Objective-C exception syntax" } */ { number++; } @try { /* Nothing, error has already been produced. */ number++; @throw o; /* Nothing, error has already been produced. */ } @catch (id object) { number++; @throw; /* Nothing, error has already been produced. */ } @finally { number++; } return number; }