+2010-09-10 Nicola Pero <nicola.pero@meta-innovation.com>
+
+ * objc/objc-act.c (objc_begin_try_stmt): Generate an error if
+ -fobjc-exceptions was not used. (objc_build_throw_stmt): Same
+ change.
+
2010-07-15 Nathan Froyd <froydnj@codesourcery.com>
* objc-act.c: Carefully replace TREE_CHAIN with DECL_CHAIN.
c->end_try_locus = input_location;
cur_try_context = c;
- if (flag_objc_sjlj_exceptions)
+ /* -fobjc-exceptions is required to enable Objective-C exceptions.
+ For example, on Darwin, ObjC exceptions require a sufficiently
+ recent version of the runtime, so the user must ask for them
+ explicitly. On other platforms, at the moment -fobjc-exceptions
+ triggers -fexceptions which again is required for exceptions to
+ work.
+ */
+ if (!flag_objc_exceptions)
{
- /* On Darwin, ObjC exceptions require a sufficiently recent
- version of the runtime, so the user must ask for them explicitly. */
- if (!flag_objc_exceptions)
- warning (0, "use %<-fobjc-exceptions%> to enable Objective-C "
- "exception syntax");
+ error_at (try_locus, "%<-fobjc-exceptions%> is required to enable Objective-C exception syntax");
}
if (flag_objc_sjlj_exceptions)
{
tree args;
- if (flag_objc_sjlj_exceptions)
+ if (!flag_objc_exceptions)
{
- /* On Darwin, ObjC exceptions require a sufficiently recent
- version of the runtime, so the user must ask for them explicitly. */
- if (!flag_objc_exceptions)
- warning (0, "use %<-fobjc-exceptions%> to enable Objective-C "
- "exception syntax");
+ error_at (loc, "%<-fobjc-exceptions%> is required to enable Objective-C exception syntax");
}
if (throw_expr == NULL)