summaryrefslogtreecommitdiffstats
path: root/gcc/objc
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2008-07-11 18:16:26 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2008-07-11 18:16:26 +0000
commit5c6e575681832b9e799b573d970c55e4efb81a1b (patch)
treec00388a092ba64841d77b31eb539029bb96b0622 /gcc/objc
parent9fc151e6f4fc066d7efc383a41ecf54b8b7ba6b6 (diff)
downloadppe42-gcc-5c6e575681832b9e799b573d970c55e4efb81a1b.tar.gz
ppe42-gcc-5c6e575681832b9e799b573d970c55e4efb81a1b.zip
./:
* c-common.h (enum rid): Add RID_CXX_COMPAT_WARN. (struct c_common_resword): Define. (D_CONLY, D_CXXONLY, D_C99, D_CXX0X, D_EXT, D_EXT89): Define. (D_ASM, D_OBJC, D_CXX_OBJC, D_CXXWARN): Define. (c_common_reswords, num_c_common_reswords): Declare. * c-common.c (c_common_reswords): New global const array. (num_c_common_reswords): New const int. * c-parser.c (struct resword, reswords): Don't define. (D_C89, D_EXT, D_EXT89, D_OBJC): Don't define. (c_parse_init): Clarify mask code. Use c_common_reswords rather than reswords. If warning about C++ keywords, give them a special RID code. (c_lex_one_token): Warn about C++ keywords. Call objc_is_reserved_word rather than OBJC_IS_AT_KEYWORD. (c_parser_external_declaration): Look for RID_xxx rather than RID_AT_xxx, for ObjC++ keywords which are also C++ keywords. (c_parser_statement_after_labels): Likewise. (c_parser_objc_class_instance_variables): Likewise. (c_parser_objc_class_declaration): Likewise. (c_parser_objc_try_catch_statement): Likewise. * c-decl.c (c_print_identifier): Ignore RID_CXX_COMPAT_WARN. (declspecs_add_type): Likewise. cp/: * lex.c (struct resword, reswords): Don't define. (D_EXT, D_ASM, D_OBJC, D_CXX0X): Don't define. (init_reswords): Clarify mask code. Use c_common_reswords rather than reswords. objc/: * objc-act.c (objc_is_reserved_word): Always check for RID_CLASS, etc., not just when OBJCPLUS is defined. testsuite/: * gcc.dg/Wcxx-compat-2.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@137724 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/objc')
-rw-r--r--gcc/objc/ChangeLog5
-rw-r--r--gcc/objc/objc-act.c5
2 files changed, 6 insertions, 4 deletions
diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog
index f5869b3bca9..18a548da635 100644
--- a/gcc/objc/ChangeLog
+++ b/gcc/objc/ChangeLog
@@ -1,3 +1,8 @@
+2008-07-11 Ian Lance Taylor <iant@google.com>
+
+ * objc-act.c (objc_is_reserved_word): Always check for RID_CLASS,
+ etc., not just when OBJCPLUS is defined.
+
2008-06-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* objc-act.c (setup_string_decl, objc_build_string_object,
diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c
index 4aef9a02017..822dd35eb8d 100644
--- a/gcc/objc/objc-act.c
+++ b/gcc/objc/objc-act.c
@@ -760,12 +760,9 @@ objc_is_reserved_word (tree ident)
unsigned char code = C_RID_CODE (ident);
return (OBJC_IS_AT_KEYWORD (code)
-#ifdef OBJCPLUS
|| code == RID_CLASS || code == RID_PUBLIC
|| code == RID_PROTECTED || code == RID_PRIVATE
- || code == RID_TRY || code == RID_THROW || code == RID_CATCH
-#endif
- );
+ || code == RID_TRY || code == RID_THROW || code == RID_CATCH);
}
/* Return true if TYPE is 'id'. */
OpenPOWER on IntegriCloud