/* Process the ObjC-specific declarations and variables for
the Objective-C++ compiler.
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005-2014 Free Software Foundation, Inc.
Contributed by Ziemowit Laski <zlaski@apple.com>
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
+Software Foundation; either version 3, or (at your option) any later
version.
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
for more details.
You should have received a copy of the GNU General Public License
-along with GCC; see the file COPYING. If not, write to the Free
-Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301, USA. */
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "tm.h"
#include "tree.h"
-#include "rtl.h"
-#include "expr.h"
#include "cp-tree.h"
-#include "c-common.h"
-#include "flags.h"
-#include "input.h"
-#include "except.h"
-#include "output.h"
-#include "toplev.h"
-#include "cpplib.h"
-#include "debug.h"
-#include "target.h"
-#include "varray.h"
+#include "hashtab.h"
+#include "c-family/c-objc.h"
#include "objc-act.h"
#include "objcp-decl.h"
/* Hacks to simulate start_struct() and finish_struct(). */
tree
-objcp_start_struct (enum tree_code code ATTRIBUTE_UNUSED, tree name)
+objcp_start_struct (location_t loc ATTRIBUTE_UNUSED,
+ enum tree_code code ATTRIBUTE_UNUSED, tree name)
{
tree s;
/* The idea here is to mimic the actions that the C++ parser takes when
}
tree
-objcp_finish_struct (tree t, tree fieldlist, tree attributes)
+objcp_finish_struct (location_t loc ATTRIBUTE_UNUSED,
+ tree t, tree fieldlist, tree attributes)
{
tree field, next_field;
finish_member_declaration (field);
}
t = finish_struct (t, attributes);
+
+ /* If we are inside an @interface and are generating the list of
+ ivars, we need to check for duplicate ivars.
+ */
+ if (fieldlist)
+ objc_detect_field_duplicates (true);
+
pop_lang_context ();
return t;