Index: objc/ChangeLog
===================================================================
--- objc/ChangeLog      (revision 170412)
+++ objc/ChangeLog      (working copy)
@@ -1,5 +1,12 @@
 2011-02-22  Nicola Pero  <nicola.pero@meta-innovation.com>
 
+       * objc-act.c (build_private_template): Do not copy the
+       CLASS_HAS_EXCEPTION_ATTR from the class to the struct.
+       * objc-act.h (CLASS_HAS_EXCEPTION_ATTR): Define using
+       TYPE_LANG_SLOT_0.
+
+2011-02-22  Nicola Pero  <nicola.pero@meta-innovation.com>
+
        PR objc/47832
        * objc-act.c (flexible_array_type_p): New.
        (add_instance_variable): Produce an error if an instance variable
Index: objc/objc-act.c
===================================================================
--- objc/objc-act.c     (revision 170412)
+++ objc/objc-act.c     (working copy)
@@ -4203,9 +4203,6 @@ build_private_template (tree klass)
       /* Copy the attributes from the class to the type.  */
       if (TREE_DEPRECATED (klass))
        TREE_DEPRECATED (record) = 1;
-
-      if (CLASS_HAS_EXCEPTION_ATTR (klass))
-       CLASS_HAS_EXCEPTION_ATTR (record) = 1;
     }
 }
 
Index: objc/objc-act.h
===================================================================
--- objc/objc-act.h     (revision 170411)
+++ objc/objc-act.h     (working copy)
@@ -164,10 +164,8 @@ typedef enum objc_property_assign_semantics {
 #define CLASS_CATEGORY_LIST(CLASS) TREE_VEC_ELT (TYPE_LANG_SLOT_1 (CLASS), 3)
 #define CLASS_PROTOCOL_LIST(CLASS) TREE_VEC_ELT (TYPE_LANG_SLOT_1 (CLASS), 4)
 #define TOTAL_CLASS_RAW_IVARS(CLASS) TREE_VEC_ELT (TYPE_LANG_SLOT_1 (CLASS), 5)
+#define CLASS_HAS_EXCEPTION_ATTR(CLASS) (TYPE_LANG_FLAG_0 (CLASS))
 
-/* FIXME */
-#define CLASS_HAS_EXCEPTION_ATTR(CLASS) ((CLASS)->type.lang_flag_0)
-
 #define PROTOCOL_NAME(CLASS) ((CLASS)->type.name)
 #define PROTOCOL_LIST(CLASS) TREE_VEC_ELT (TYPE_LANG_SLOT_1 (CLASS), 0)
 #define PROTOCOL_NST_METHODS(CLASS) ((CLASS)->type.minval)
Index: testsuite/ChangeLog
===================================================================
--- testsuite/ChangeLog (revision 170412)
+++ testsuite/ChangeLog (working copy)
@@ -1,5 +1,9 @@
 2011-02-22  Nicola Pero  <nicola.pero@meta-innovation.com>
 
+       * objc.dg/attributes/objc-exception-1.m: New.
+
+2011-02-22  Nicola Pero  <nicola.pero@meta-innovation.com>
+
        PR objc/47832
        * objc.dg/type-size-3.m: Updated error message.
        * objc.dg/type-size-4.m: New test.
Index: testsuite/objc.dg/attributes/objc-exception-1.m
===================================================================
--- testsuite/objc.dg/attributes/objc-exception-1.m     (revision 0)
+++ testsuite/objc.dg/attributes/objc-exception-1.m     (revision 0)
@@ -0,0 +1,32 @@
+/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, February 2011.  */
+/* { dg-do compile } */
+
+/* Test that the 'objc_exception' attribute is accepted for
+   @interfaces, but not for anything else.  */
+
+#include <objc/objc.h>
+
+/* Fine.  */
+__attribute__ ((objc_exception))
+@interface MyClass
+{
+  Class isa;
+}
+@end
+
+/* Fine.  */
+__attribute__ ((__objc_exception__))
+@interface MyClass2
+{
+  Class isa;
+}
+@end
+
+__attribute__ ((objc_exception))
+@protocol MyProtocol; /* { dg-warning "ignored" } */
+
+__attribute__ ((objc_exception))
+int myVariable; /* { dg-warning "ignored" } */
+
+__attribute__ ((objc_exception))
+int myFunction (int argument); /* { dg-warning "ignored" } */
