aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/objc/ChangeLog12
-rw-r--r--gcc/objc/objc-act.c11
-rw-r--r--gcc/testsuite/ChangeLog9
-rw-r--r--gcc/testsuite/obj-c++.dg/template-7.mm21
4 files changed, 52 insertions, 1 deletions
diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog
index 0a78bc7..fd8f15d 100644
--- a/gcc/objc/ChangeLog
+++ b/gcc/objc/ChangeLog
@@ -1,6 +1,18 @@
2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com>
Merge from 'apple/trunk' branch on FSF servers.
+
+ 2006-03-10 Fariborz Jahanian <fjahanian@apple.com>
+
+ Radar 4407151
+ * objc/objc-act.c (objc_is_class_name): template parameter is not
+ an objective class name.
+ (objc_generate_cxx_cdtors): Check for the null
+ objc_implementation_context.
+
+2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com>
+
+ Merge from 'apple/trunk' branch on FSF servers.
2005-11-08 Fariborz Jahanian <fjahanian@apple.com>
diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c
index 95fc7e7..53a29bc 100644
--- a/gcc/objc/objc-act.c
+++ b/gcc/objc/objc-act.c
@@ -3652,7 +3652,12 @@ objc_is_class_name (tree ident)
ident = OBJC_TYPE_NAME (ident);
#ifdef OBJCPLUS
if (ident && TREE_CODE (ident) == TYPE_DECL)
- ident = DECL_NAME (ident);
+ {
+ tree type = TREE_TYPE (ident);
+ if (type && TREE_CODE (type) == TEMPLATE_TYPE_PARM)
+ return NULL_TREE;
+ ident = DECL_NAME (ident);
+ }
#endif
if (!ident || TREE_CODE (ident) != IDENTIFIER_NODE)
return NULL_TREE;
@@ -5236,6 +5241,10 @@ objc_generate_cxx_cdtors (void)
bool need_ctor = false, need_dtor = false;
tree ivar;
+ /* Error case, due to possibly an extra @end. */
+ if (!objc_implementation_context)
+ return;
+
/* We do not want to do this for categories, since they do not have
their own ivars. */
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index d883373..c7171d6 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,4 +1,13 @@
2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com>
+
+ Merge from 'apple/trunk' branch on FSF servers.
+
+ 2006-01-17 Fariborz Jahanian <fjahanian@apple.com>
+
+ Radar 4407151
+ * obj-c++.dg/template-7.mm: New.
+
+2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com>
* objc.dg/proto-qual-1.m: Adjust test for GNU runtime to match
bugfix.
diff --git a/gcc/testsuite/obj-c++.dg/template-7.mm b/gcc/testsuite/obj-c++.dg/template-7.mm
new file mode 100644
index 0000000..8621abe
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/template-7.mm
@@ -0,0 +1,21 @@
+// Test that objective-c++ does not confuse a template parameter named 'Object'
+// with an interface of the same name.
+// Author: Fariborz Jahanian <fjahanian@apple.com>
+// { dg-do compile }
+// { dg-options "" }
+typedef struct objc_class *Class;
+
+@interface Object
+{
+ Class isa;
+}
+@end
+
+template <class Object>
+struct pyobject_type
+{
+ static Object* checked_downcast(Object* x)
+ {
+ return x;
+ }
+};