diff options
author | mrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4> | 1994-05-06 09:27:46 +0000 |
---|---|---|
committer | mrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4> | 1994-05-06 09:27:46 +0000 |
commit | f96b25bbd7b2f89fb3a438fd96dc36e1e4456754 (patch) | |
tree | 983ac189ca3cb9a9e610fd162d9619dc1663d682 /gcc/cp/lex.c | |
parent | 3027adcfc650078652ab6c0f5345fcaf61a833d3 (diff) | |
download | ppe42-gcc-f96b25bbd7b2f89fb3a438fd96dc36e1e4456754.tar.gz ppe42-gcc-f96b25bbd7b2f89fb3a438fd96dc36e1e4456754.zip |
36th Cygnus<->FSF merge
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@7221 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/lex.c')
-rw-r--r-- | gcc/cp/lex.c | 52 |
1 files changed, 21 insertions, 31 deletions
diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c index 51cb77238e2..7c88ba56170 100644 --- a/gcc/cp/lex.c +++ b/gcc/cp/lex.c @@ -766,40 +766,16 @@ init_lex () do { struct resword *s = is_reserved_word (STRING, sizeof (STRING) - 1); \ if (s) s->name = ""; } while (0) - if (flag_ansi_exceptions) - flag_handle_exceptions = 2; - - if (!flag_ansi_exceptions) +#if 0 + /* let's parse things, and if they use it, then give them an error. */ + if (!flag_handle_exceptions) { + UNSET_RESERVED_WORD ("throw"); + UNSET_RESERVED_WORD ("try"); UNSET_RESERVED_WORD ("catch"); } +#endif - if (! flag_handle_exceptions) - { - /* Easiest way to not recognize exception - handling extensions... */ - UNSET_RESERVED_WORD ("all"); - UNSET_RESERVED_WORD ("except"); - UNSET_RESERVED_WORD ("exception"); - UNSET_RESERVED_WORD ("raise"); - UNSET_RESERVED_WORD ("raises"); - UNSET_RESERVED_WORD ("reraise"); - UNSET_RESERVED_WORD ("try"); - UNSET_RESERVED_WORD ("throw"); - } - else if (flag_ansi_exceptions) - { - /* Easiest way to not recognize exception - handling extensions... */ - UNSET_RESERVED_WORD ("exception"); - UNSET_RESERVED_WORD ("all"); - UNSET_RESERVED_WORD ("except"); - UNSET_RESERVED_WORD ("raise"); - UNSET_RESERVED_WORD ("raises"); - UNSET_RESERVED_WORD ("reraise"); - is_reserved_word ("try", sizeof ("try") - 1)->token = ANSI_TRY; - is_reserved_word ("throw", sizeof ("throw") - 1)->token = ANSI_THROW; - } if (! (flag_gc || flag_dossier)) { UNSET_RESERVED_WORD ("classof"); @@ -3171,6 +3147,13 @@ do_identifier (token) } } + /* Remember that this name has been used in the class definition, as per + [class.scope0] */ + if (id && current_class_type + && TYPE_BEING_DEFINED (current_class_type) + && ! IDENTIFIER_CLASS_VALUE (token)) + pushdecl_class_level (id); + if (!id || id == error_mark_node) { if (id == error_mark_node && current_class_type != NULL_TREE) @@ -3496,7 +3479,14 @@ real_yylex () if (strcmp ("catch", token_buffer) == 0 || strcmp ("throw", token_buffer) == 0 || strcmp ("try", token_buffer) == 0) - pedwarn ("`catch', `throw', and `try' are all C++ reserved words"); + { + static int did_warn = 0; + if (! did_warn && ! flag_handle_exceptions) + { + pedwarn ("`catch', `throw', and `try' are all C++ reserved words"); + did_warn = 1; + } + } if (value == IDENTIFIER || value == TYPESPEC) GNU_xref_ref (current_function_decl, token_buffer); |