aboutsummaryrefslogtreecommitdiff
path: root/gcc/objc/objc-act.c
diff options
context:
space:
mode:
authorNicola Pero <nicola.pero@meta-innovation.com>2010-11-29 20:45:49 +0000
committerNicola Pero <nicola@gcc.gnu.org>2010-11-29 20:45:49 +0000
commit98cf223ca9c9d0536d56aa16c198b3ecb3951509 (patch)
tree5fbe0db7e4a7ed1c71df82aac25a743af0e5c20d /gcc/objc/objc-act.c
parentd402edc15d4b829e03d9f0a904e813bb24627a02 (diff)
downloadgcc-98cf223ca9c9d0536d56aa16c198b3ecb3951509.zip
gcc-98cf223ca9c9d0536d56aa16c198b3ecb3951509.tar.gz
gcc-98cf223ca9c9d0536d56aa16c198b3ecb3951509.tar.bz2
In gcc/objc/: 2010-11-29 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/objc/: 2010-11-29 Nicola Pero <nicola.pero@meta-innovation.com> * objc-act.c (start_class): When a class is reimplemented, generate an error and avoid adding the class to the list of implemented classes again, but do not return error_mark_node. In gcc/testsuite/: 2010-11-29 Nicola Pero <nicola.pero@meta-innovation.com> * objc.dg/duplicate-class-1.m: New. * obj-c++.dg/duplicate-class-1.mm: New. From-SVN: r167270
Diffstat (limited to 'gcc/objc/objc-act.c')
-rw-r--r--gcc/objc/objc-act.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c
index 2382da4..8de8e25 100644
--- a/gcc/objc/objc-act.c
+++ b/gcc/objc/objc-act.c
@@ -9537,10 +9537,13 @@ start_class (enum tree_code code, tree class_name, tree super_name,
{
error ("reimplementation of class %qE",
class_name);
- return error_mark_node;
+ /* TODO: error message saying where it was previously
+ implemented. */
+ break;
}
- implemented_classes = tree_cons (NULL_TREE, class_name,
- implemented_classes);
+ if (chain == NULL_TREE)
+ implemented_classes = tree_cons (NULL_TREE, class_name,
+ implemented_classes);
}
/* Reset for multiple classes per file. */