cpplex.c (parse_name): Might have to glue a CPP_OTHER token before the name.
authorZack Weinberg <zack@gcc.gnu.org>
Fri, 4 Aug 2000 01:30:06 +0000 (01:30 +0000)
committerZack Weinberg <zack@gcc.gnu.org>
Fri, 4 Aug 2000 01:30:06 +0000 (01:30 +0000)
* cpplex.c (parse_name): Might have to glue a CPP_OTHER token
before the name.
(lex_line): Glue @ onto the beginning of identifiers and
string constants, in Objective-C mode.
(output_token, spell_token): Handle CPP_OSTRING.
(can_paste, maybe_paste_with_next): Handle pasting @ onto the
beginning of a NAME or a STRING, in objc mode.

* cpplib.c (get_define_node): Do not permit identifiers that
begin with @ to be #defined.
* cppmacro.c (CAN_PASTE_AFTER): Add CPP_OTHER.
* cpplib.h (TTYPE_TABLE): Add CPP_OSTRING.

* c-lang.c, objc/objc-act.c (build_objc_string): Delete.
* c-tree.h (build_objc_string): Delete prototype.
* objc/objc-tree.def: Delete OBJC_STRING_CST.
* c-lex.c (yylex): Use build_string for all three kinds of strings.

* gcc.dg/cpp/20000625-2.c: Don't expect a warning on line 4.

From-SVN: r35470

13 files changed:
gcc/ChangeLog
gcc/c-lang.c
gcc/c-lex.c
gcc/c-parse.in
gcc/c-tree.h
gcc/cpplex.c
gcc/cpplib.c
gcc/cpplib.h
gcc/cppmacro.c
gcc/objc/objc-act.c
gcc/objc/objc-tree.def
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/cpp/20000625-2.c

index 6472f75bf810d0990b678ee9a4971156d9b9142c..237bf485eee44ba5fe6f9c5e439042b2861cf0b6 100644 (file)
@@ -1,3 +1,25 @@
+2000-08-03  Zack Weinberg  <zack@wolery.cumb.org>
+
+       * cpplex.c (parse_name): Might have to glue a CPP_OTHER token
+       before the name.
+       (lex_line): Glue @ onto the beginning of identifiers and
+       string constants, in Objective-C mode.
+       (output_token, spell_token): Handle CPP_OSTRING.
+       (can_paste, maybe_paste_with_next): Handle pasting @ onto the
+       beginning of a NAME or a STRING, in objc mode.
+
+       * cpplib.c (get_define_node): Do not permit identifiers that
+       begin with @ to be #defined.
+       * cppmacro.c (CAN_PASTE_AFTER): Add CPP_OTHER.
+       * cpplib.h (TTYPE_TABLE): Add CPP_OSTRING.
+
+       * c-lang.c, objc/objc-act.c (build_objc_string): Delete.
+       * c-tree.h (build_objc_string): Delete prototype.
+       * objc/objc-tree.def: Delete OBJC_STRING_CST.
+       * c-lex.c (yylex): Use build_string for all three kinds of strings.
+
+       * c-parse.in, objc/objc-act.c: Update commentary.
+
 2000-08-03  Mark Mitchell  <mark@codesourcery.com>
 
        * extend.texi: Fix typo in last change.
@@ -33,8 +55,8 @@ Thu Aug  3 10:05:53 2000  Akiko Matsushita <matusita@sra.co.jp>
 
 2000-08-03  Michael Poole  <poole@troilus.org>
 
-        * tm.texi (Register Classes): Clarify order of sub-initializers
-        in REG_CLASS_CONTENTS.
+       * tm.texi (Register Classes): Clarify order of sub-initializers
+       in REG_CLASS_CONTENTS.
 
 Thu Aug  3 15:53:03 2000  J"orn Rennecke <amylaar@cygnus.co.uk>
 
@@ -125,7 +147,7 @@ Wed Aug  2 15:59:34 MET DST 2000  Jan Hubicka  <jh@suse.cz>
 
        * cppmain.c (cb_define, cb_undef): Don't generate any output
        if not done_initializing.
-       * cpplex.c (maybe_paste_with_next): When the token after a ## 
+       * cpplex.c (maybe_paste_with_next): When the token after a ##
        is an omitted rest argument, only delete the token before it
        if that token is a comma.  Do not warn about bogus token
        pastes for , ## rest_arg.
@@ -141,7 +163,7 @@ Wed Aug  2 15:59:34 MET DST 2000  Jan Hubicka  <jh@suse.cz>
 
        * config/i386/beos-elf.h (INCLUDE_DEFAULTS): Add additional
        Be directories to search path.
-       
+
        Remove support for __declspec(dllimport) and __declspec(dllexport).
        This is leftover cruft from the earlier BeOS gcc port when BeOS
        used Microsoft's PE object file format.
@@ -159,15 +181,15 @@ Wed Aug  2 15:59:34 MET DST 2000  Jan Hubicka  <jh@suse.cz>
        (ASM_OUTPUT_ALIGNED_DECL_COMMON): Remove.
        (ASM_OUTPUT_ALIGNED_LOCAL): Remove.
        (STRIP_NAME_ENCODING): Remove.
-       
+
        Remove support for obsolete version of BeOS that is no longer
        supported by Be.
        * configure.in (i*86-*-beospe*): Remove.
        * config/i386/beos-pe.h: Remove.
-       
+
 2000-08-01  Jeffrey Oldham  <oldham@codesourcery.com>
-            Mark Mitchell <mark@codesourcery.com>
-       
+           Mark Mitchell <mark@codesourcery.com>
+
        * Makefile.in (OBJS): Added dce.o.
        (ssa.o): Updated target to include ssa.h.
        (flow.o): Likewise.
@@ -176,7 +198,7 @@ Wed Aug  2 15:59:34 MET DST 2000  Jan Hubicka  <jh@suse.cz>
        * basic-block.h: Added comments.
        (INVALID_BLOCK): Added definition.
        (connect_infinite_loops_to_exit): Added declaration.
-       Moved SSA declarations to ssa.h.        
+       Moved SSA declarations to ssa.h.
        * flow.c: Added inclusion of ssa.h.
        (struct depth_first_search_dsS, depth_first_search_ds):
        Added definitions.
@@ -205,9 +227,9 @@ Wed Aug  2 15:59:34 MET DST 2000  Jan Hubicka  <jh@suse.cz>
        Defined flag_ssa.
        (f_options): Added dce entry.
        * invoke.texi: Document -fdce.  Emphasize experimental status of
-       -fssa. 
+       -fssa.
        * dce: New file.
-       
+
 2000-08-01  Zack Weinberg  <zack@wolery.cumb.org>
 
        * cpperror.c (v_message): Split into _cpp_begin_message and
@@ -619,7 +641,7 @@ Sun Jul 30 20:27:36 MET DST 2000  Jan Hubicka  <jh@suse.cz>
 
 Sun Jul 30 20:25:21 MET DST 2000  Jan Hubicka  <jh@suse.cz>
 
-       * function.c (assign_stack_local_1, assign_stack_temp_for_type): 
+       * function.c (assign_stack_local_1, assign_stack_temp_for_type):
        Do not call gen_mode_alignment when mode is BLKmode.
 
 Sun Jul 30 20:21:54 MET DST 2000  Jan Hubicka  <jh@suse.cz>
@@ -655,7 +677,7 @@ Sun Jul 30 20:08:37 MET DST 2000  Jan Hubicka  <jh@suse.cz>
        (c4x_valid_type_attribute_p): Likewise.
        * config/c4x/c4x.h (FUNCTION_PROLOGUE, FUNCTION_EPILOGUE): Delete.
        (FUNCTION_BLOCK_PROFILER_EXIT): Convert to emit RTL.
-       
+
 2000-07-30  Michael Hayes  <m.hayes@elec.canterbury.ac.nz>
 
        * config/c4x/c4x.c (c4x_emit_move_sequence): Use loadqi_big_constant
@@ -672,7 +694,7 @@ Sun Jul 30 20:08:37 MET DST 2000  Jan Hubicka  <jh@suse.cz>
        * config/c4x/c4x.h (ASM_FORMAT_PRIVATE_NAME): Output $ in label.
 
 2000-07-30  Michael Hayes  <m.hayes@elec.canterbury.ac.nz>
-       
+
        * config/c4x/c4x.h (IS_XXX_REGNO): Rewrite to avoid unsigned warnings.
 
 2000-07-30  Michael Hayes  <m.hayes@elec.canterbury.ac.nz>
@@ -699,7 +721,7 @@ Sun Jul 30 20:08:37 MET DST 2000  Jan Hubicka  <jh@suse.cz>
        (make_equivalent_phi_alternatives_equivalent): Likewise.
        (for_each_successor_phi): Likewise.
        (convert_from_ssa): Modify phi-node deletion algorithm.
-       
+
 2000-07-29  Andreas Jaeger  <aj@suse.de>
 
        * configure.in (mips*-*-linux*): Use mips*el to check for little
@@ -771,7 +793,7 @@ Sun Jul 30 20:08:37 MET DST 2000  Jan Hubicka  <jh@suse.cz>
        (__do_global_ctors): Prototype.
 
        * gcse.c (record_one_set, pre_delete): Remove unused variables.
-       
+
        * rs6000.c (rs6000_maybe_dead): Delete unused prototype.
        (print_operand): Initialize variable `t'.
 
@@ -791,7 +813,7 @@ Sun Jul 30 20:08:37 MET DST 2000  Jan Hubicka  <jh@suse.cz>
        (--with-included-gettext): Likewise.
        (--enable-maintainer-mode): New description added.
        * extend.texi (-fstrict-prototype): Add missing '.'.
-       
+
 2000-07-27  Jim Wilson  <wilson@cygnus.com>
 
        * dwarf2out.c (gen_decl_die): Don't call gen_abstract_function if
@@ -860,7 +882,7 @@ Thu Jul 27 09:25:17 2000  Akiko Matsushita  <matusita@sra.co.jp>
 
        * pa/x-pa-hpux: Add -D_HIUX_SOURCE to FIXPROTO_DEFINES
        for HI-UX/WE2 systems.
-       
+
 2000-07-24  Bruce Korb  <bkorb@gnu.org>
 
        * fixincl/fixfixes.c(emit_gnu_type): rewrote to *rely* on GCC
@@ -873,9 +895,9 @@ Thu Jul 27 11:54:17 2000  Andrew Cagney  <cagney@b1.cygnus.com>
 
        * cpp.texi: Append a trailing full-stop to xrefs where needed.
 
-2000-07-26  Dave Pitts  <dpitts@cozx.com>      
+2000-07-26  Dave Pitts  <dpitts@cozx.com>
 
-       * i370.c: Remove LONGEXTERNAL ifdef from alias_number. Added hash 
+       * i370.c: Remove LONGEXTERNAL ifdef from alias_number. Added hash
        routine constants.
        (mvs_hash_alias): New function.
        (mvs_add_alias): Change argument spacing.
@@ -1037,7 +1059,7 @@ Tue Jul 25 23:08:33 2000  J"orn Rennecke <amylaar@cygnus.co.uk>
        UNALIGNED_INT_ASM_OP.
        (def_cfa_1): Don't emit def_cfa_register or def_cfa_offset to adjust
        a location expression.
-       (dwarf2out_frame_debug_expr): Lose cfa_old_reg stuff.  Don't 
+       (dwarf2out_frame_debug_expr): Lose cfa_old_reg stuff.  Don't
        assume indirect access if we're saving the CFA address exactly.
 
        * Makefile.in (bootstrap): Move -BstageN/ to the end.
@@ -1074,9 +1096,9 @@ Mon Jul 24 02:04:52 2000  Jeffrey A Law  (law@cygnus.com)
        * c-semantics.c (make_rtl_for_local_static): Use TREE_ASM_WRITTEN
        to figure out whether or not a variable has already been emitted.
 
-Sun Jul 23 14:49:12 2000  Jason Eckhardt  <jle@cygnus.com> 
+Sun Jul 23 14:49:12 2000  Jason Eckhardt  <jle@cygnus.com>
 
-       * config/i860/i860.md (untyped_call expander): Use GEN_CALL 
+       * config/i860/i860.md (untyped_call expander): Use GEN_CALL
        instead of gen_call.
 
 Sun Jul 23 11:52:03 2000  George Helffrich (george@gly.bris.ac.uk)
index a34f306b4ffdcc95eed6d9a1b2ac2e280204b532..504f342c70f536233cd2f69160d66d0694928c7a 100644 (file)
@@ -171,15 +171,6 @@ recognize_objc_keyword ()
   return 0;
 }
 
-tree
-build_objc_string (len, str)
-    int len ATTRIBUTE_UNUSED;
-    const char *str ATTRIBUTE_UNUSED;
-{
-  abort ();
-  return NULL_TREE;
-}
-
 /* Used by c-typeck.c (build_external_ref), but only for objc.  */
 
 tree
index 9ceb2bfcc62c50984f38784938ffa94e1cf8b99b..616ecbe2080491e97c9e2b59d31cd529d2e2698c 100644 (file)
@@ -2268,25 +2268,19 @@ yylex ()
        /* We have read the entire constant.
           Construct a STRING_CST for the result.  */
 
+       yylval.ttype = build_string (p - (token_buffer + 1), token_buffer + 1);
        if (wide_flag)
          {
-           yylval.ttype = build_string (p - (token_buffer + 1),
-                                        token_buffer + 1);
            TREE_TYPE (yylval.ttype) = wchar_array_type_node;
            value = STRING;
          }
        else if (objc_flag)
          {
-           /* Return an Objective-C @"..." constant string object.  */
-           yylval.ttype = build_objc_string (p - (token_buffer + 1),
-                                             token_buffer + 1);
            TREE_TYPE (yylval.ttype) = char_array_type_node;
            value = OBJC_STRING;
          }
        else
          {
-           yylval.ttype = build_string (p - (token_buffer + 1),
-                                        token_buffer + 1);
            TREE_TYPE (yylval.ttype) = char_array_type_node;
            value = STRING;
          }
index b0cb0019ccd78fa9c3608cd2305e77f146ef7586..c58402f41882c6b4b0759ee37e3b2d6f940ab73e 100644 (file)
@@ -150,7 +150,7 @@ end ifc
 %token CLASSNAME PUBLIC PRIVATE PROTECTED PROTOCOL OBJECTNAME CLASS ALIAS
 
 /* Objective-C string constants in raw form.
-   yylval is an OBJC_STRING_CST node.  */
+   yylval is an STRING_CST node.  */
 %token OBJC_STRING
 
 
@@ -753,8 +753,8 @@ end ifc
        ;
 
 ifobjc
-/* Produces an OBJC_STRING_CST with perhaps more OBJC_STRING_CSTs chained
-   onto it.  */
+/* Produces an STRING_CST with perhaps more STRING_CSTs chained
+   onto it, which is to be read as an ObjC string object.  */
 objc_string:
          OBJC_STRING
        | objc_string OBJC_STRING
index 21236078dc7875ff743b6075908f2a90dcce7def..3af50a4295d80a14a9679bdb01663946a243c1f1 100644 (file)
@@ -142,7 +142,6 @@ extern int maybe_objc_comptypes                 PARAMS ((tree, tree, int));
 extern tree maybe_building_objc_message_expr    PARAMS ((void));
 extern tree maybe_objc_method_name             PARAMS ((tree));
 extern int recognize_objc_keyword              PARAMS ((void));
-extern tree build_objc_string                  PARAMS ((int, const char *));
 extern tree lookup_objc_ivar                   PARAMS ((tree));
 \f
 /* in c-parse.in */
index 7485fde9851060b570c96c5d284f1fc844b5f08e..5307edc730aca4825cbf3fe4a321bd7efedf2fe4 100644 (file)
@@ -1008,15 +1008,27 @@ parse_name (pfile, tok, cur, rlimit)
     }
   len = cur - name;
 
-  if (tok->val.node == 0)
+  if (tok->type == CPP_NAME && tok->val.node == 0)
     tok->val.node = _cpp_lookup_with_hash (pfile, name, len, r);
   else
     {
-      unsigned int oldlen = tok->val.node->length;
-      U_CHAR *newname = alloca (oldlen + len);
-      memcpy (newname, tok->val.node->name, oldlen);
+      unsigned int oldlen;
+      U_CHAR *newname;
+
+      if (tok->type == CPP_NAME)
+       oldlen = tok->val.node->length;
+      else
+       oldlen = 1;
+
+      newname = alloca (oldlen + len);
+
+      if (tok->type == CPP_NAME)
+       memcpy (newname, tok->val.node->name, oldlen);
+      else
+       newname[0] = tok->val.aux;
       memcpy (newname + oldlen, name, len);
       tok->val.node = cpp_lookup (pfile, newname, len + oldlen);
+      tok->type = CPP_NAME;
     }
 
   return cur;
@@ -1373,8 +1385,16 @@ lex_line (pfile, list)
        case 'S': case 'T': case 'U': case 'V': case 'W': case 'X':
        case 'Y': case 'Z':
          cur--;                     /* Backup character.  */
-         cur_token->val.node = 0;
-         cur_token->type = CPP_NAME; /* Identifier, macro etc.  */
+
+         /* In Objective C, '@' may begin certain keywords.  */
+         if (CPP_OPTION (pfile, objc) && cur_token[-1].type == CPP_OTHER
+             && cur_token[-1].val.aux == '@' && IMMED_TOKEN ())
+           cur_token--;
+         else
+           {
+             cur_token->val.node = 0;
+             cur_token->type = CPP_NAME; /* Identifier, macro etc.  */
+           }
 
        continue_name:
          cur = parse_name (pfile, cur_token, cur, buffer->rlimit);
@@ -1394,12 +1414,21 @@ lex_line (pfile, list)
          break;
 
        case '\'':
+         cur_token->type = CPP_CHAR;
+         if (cur_token[-1].type == CPP_NAME && IMMED_TOKEN ()
+             && cur_token[-1].val.node == pfile->spec_nodes->n_L)
+           BACKUP_TOKEN (CPP_WCHAR);
+         goto do_parse_string;
+         
        case '\"':
-         cur_token->type = c == '\'' ? CPP_CHAR : CPP_STRING;
-         /* Do we have a wide string?  */
+         cur_token->type = CPP_STRING;
          if (cur_token[-1].type == CPP_NAME && IMMED_TOKEN ()
              && cur_token[-1].val.node == pfile->spec_nodes->n_L)
-           BACKUP_TOKEN (c == '\'' ? CPP_WCHAR : CPP_WSTRING);
+           BACKUP_TOKEN (CPP_WSTRING);
+         else if (CPP_OPTION (pfile, objc)
+                  && cur_token[-1].type == CPP_OTHER && IMMED_TOKEN ()
+                  && cur_token[-1].val.aux == '@')
+           BACKUP_TOKEN (CPP_OSTRING);
 
        do_parse_string:
          /* Here c is one of ' " or >.  */
@@ -1883,20 +1912,21 @@ output_token (pfile, fp, token, prev, white)
 
     case SPELL_STRING:
       {
-       if (token->type == CPP_WSTRING || token->type == CPP_WCHAR)
-         putc ('L', fp);
-
-       if (token->type == CPP_STRING || token->type == CPP_WSTRING)
-         putc ('"', fp);
-       if (token->type == CPP_CHAR || token->type == CPP_WCHAR)
-         putc ('\'', fp);
-
+       int left, right, tag;
+       switch (token->type)
+         {
+         case CPP_STRING:      left = '"';  right = '"';  tag = '\0'; break;
+         case CPP_WSTRING:     left = '"';  right = '"';  tag = 'L';  break;
+         case CPP_OSTRING:     left = '"';  right = '"';  tag = '@';  break;
+         case CPP_CHAR:        left = '\''; right = '\''; tag = '\0'; break;
+         case CPP_WCHAR:       left = '\''; right = '\''; tag = 'L';  break;
+         case CPP_HEADER_NAME: left = '<';  right = '>';  tag = '\0'; break;
+         default:              left = '\0'; right = '\0'; tag = '\0'; break;
+         }
+       if (tag) putc (tag, fp);
+       if (left) putc (left, fp);
        fwrite (token->val.str.text, 1, token->val.str.len, fp);
-       
-       if (token->type == CPP_STRING || token->type == CPP_WSTRING)
-         putc ('"', fp);
-       if (token->type == CPP_CHAR || token->type == CPP_WCHAR)
-         putc ('\'', fp);
+       if (right) putc (right, fp);
       }
       break;
 
@@ -1999,21 +2029,22 @@ spell_token (pfile, token, buffer)
 
     case SPELL_STRING:
       {
-       if (token->type == CPP_WSTRING || token->type == CPP_WCHAR)
-         *buffer++ = 'L';
-
-       if (token->type == CPP_STRING || token->type == CPP_WSTRING)
-         *buffer++ = '"';
-       if (token->type == CPP_CHAR || token->type == CPP_WCHAR)
-         *buffer++ = '\'';
-
+       int left, right, tag;
+       switch (token->type)
+         {
+         case CPP_STRING:      left = '"';  right = '"';  tag = '\0'; break;
+         case CPP_WSTRING:     left = '"';  right = '"';  tag = 'L';  break;
+         case CPP_OSTRING:     left = '"';  right = '"';  tag = '@';  break;
+         case CPP_CHAR:        left = '\''; right = '\''; tag = '\0'; break;
+         case CPP_WCHAR:       left = '\''; right = '\''; tag = 'L';  break;
+         case CPP_HEADER_NAME: left = '<';  right = '>';  tag = '\0'; break;
+         default:              left = '\0'; right = '\0'; tag = '\0'; break;
+         }
+       if (tag) *buffer++ = tag;
+       if (left) *buffer++ = left;
        memcpy (buffer, token->val.str.text, token->val.str.len);
        buffer += token->val.str.len;
-       
-       if (token->type == CPP_STRING || token->type == CPP_WSTRING)
-         *buffer++ = '"';
-       if (token->type == CPP_CHAR || token->type == CPP_WCHAR)
-         *buffer++ = '\'';
+       if (right) *buffer++ = right;
       }
       break;
 
@@ -2700,6 +2731,13 @@ can_paste (pfile, token1, token2, digraph)
        return CPP_NUMBER;
       break;
 
+    case CPP_OTHER:
+      if (CPP_OPTION (pfile, objc) && token1->val.aux == '@')
+       {
+         if (b == CPP_NAME)    return CPP_NAME;
+         if (b == CPP_STRING)  return CPP_OSTRING;
+       }
+
     default:
       break;
     }
@@ -2789,7 +2827,8 @@ maybe_paste_with_next (pfile, token)
                  pasted->val.str.len = end - buf;
                }
            }
-         else if (type == CPP_WCHAR || type == CPP_WSTRING)
+         else if (type == CPP_WCHAR || type == CPP_WSTRING
+                  || type == CPP_OSTRING)
            pasted = duplicate_token (pfile, second);
          else
            {
index fe96d4ed37684c0587960395b1f54bb055ec9c16..1ce9bbfeca8c90eb796f29184a6ad00078e6f34e 100644 (file)
@@ -242,6 +242,16 @@ get_define_node (pfile)
       return 0;
     }
 
+  /* In Objective C, some keywords begin with '@', but general identifiers
+     do not, and you're not allowed to #define them.  */
+  if (token->val.node->name[0] == '@')
+    {
+      cpp_error_with_line (pfile, token->line, token->col,
+                          "\"%s\" cannot be used as a macro name",
+                          token->val.node->name);
+      return 0;
+    }
+
   /* Check for poisoned identifiers now.  */
   if (token->val.node->type == T_POISON)
     {
index 20bea99a19ea457428efb31e5753aa0545a2cf42..ad5909e8274f078526ac89d632f1be35e753c79c 100644 (file)
@@ -123,6 +123,7 @@ typedef struct cpp_hashnode cpp_hashnode;
 \
   TK(CPP_STRING,       SPELL_STRING)   /* "string" */                  \
   TK(CPP_WSTRING,      SPELL_STRING)   /* L"string" */                 \
+  TK(CPP_OSTRING,      SPELL_STRING)   /* @"string" - Objective C */   \
   TK(CPP_HEADER_NAME,  SPELL_STRING)   /* <stdio.h> in #include */     \
 \
   TK(CPP_COMMENT,      SPELL_STRING)   /* Only if output comments.  */ \
index b78e5f0fbc2b4c3297f9b562a60092d9dc6ef37f..00f2dfb3eef6a77b156a5b53eef96b1eb111be54 100644 (file)
@@ -55,12 +55,14 @@ static cpp_toklist * alloc_macro PARAMS ((cpp_reader *, struct macro_info *));
 
 /* These are all the tokens that can have something pasted after them.
    Comma is included in the list only to support the GNU varargs extension
-   (where you write a ## b and a disappears if b is an empty rest argument).  */
+   (where you write a ## b and a disappears if b is an empty rest argument).
+   CPP_OTHER is included because of Objective C's use of '@'.  */
 #define CAN_PASTE_AFTER(type) \
 ((type) <= CPP_LAST_EQ || (type) == CPP_COLON || (type) == CPP_HASH \
  || (type) == CPP_DEREF || (type) == CPP_DOT || (type) == CPP_NAME \
  || (type) == CPP_INT || (type) == CPP_FLOAT || (type) == CPP_NUMBER \
- || (type) == CPP_MACRO_ARG || (type) == CPP_PLACEMARKER || (type) == CPP_COMMA)
+ || (type) == CPP_MACRO_ARG || (type) == CPP_PLACEMARKER \
+ || (type) == CPP_COMMA || (type) == CPP_OTHER)
 
 /* Scans for a given token, returning the parameter number if found,
    or 0 if not found.  Scans from FIRST to TOKEN - 1 or the first
index ac33492a10f9da22ba97c4865321b9c199ddf90c..a96533c728cba17e635a0e48d5f8300d8b4583c2 100644 (file)
@@ -1410,22 +1410,7 @@ my_build_string (len, str)
   return a_string;
 }
 
-/* Return a newly constructed OBJC_STRING_CST node whose value is
-   the LEN characters at STR.
-   The TREE_TYPE is not initialized.  */
-
-tree
-build_objc_string (len, str)
-     int len;
-     const char *str;
-{
-  tree s = build_string (len, str);
-
-  TREE_SET_CODE (s, OBJC_STRING_CST);
-  return s;
-}
-
-/* Given a chain of OBJC_STRING_CST's, build a static instance of
+/* Given a chain of STRING_CST's, build a static instance of
    NXConstanString which points at the concatenation of those strings.
    We place the string object in the __string_objects section of the
    __OBJC segment.  The Objective-C runtime will initialize the isa
@@ -1451,7 +1436,6 @@ build_objc_string_object (strings)
 
   add_class_reference (constant_string_id);
 
-  /* Combine_strings will work for OBJC_STRING_CST's too.  */
   string = combine_strings (strings);
   TREE_SET_CODE (string, STRING_CST);
   length = TREE_STRING_LENGTH (string) - 1;
index a6616243d106b90e49247e02e672221f05945fa0..dad4330b6d5ee3b6ae07cec5257d48363c703468 100644 (file)
@@ -32,6 +32,3 @@ DEFTREECODE (PROTOCOL_INTERFACE_TYPE, "protocol_interface_type", 't', 0)
 DEFTREECODE (KEYWORD_DECL, "keyword_decl", 'd', 0)
 DEFTREECODE (INSTANCE_METHOD_DECL, "instance_method_decl", 'd', 0)
 DEFTREECODE (CLASS_METHOD_DECL, "class_method_decl", 'd', 0)
-
-/* Objective-C constants.  */
-DEFTREECODE (OBJC_STRING_CST, "objc_string_cst", 'c', 3)
index d2a731611a749f6249731fde0cb3d342ff3e4972..bb483fcfc1327749b927a85d96274d69eb3a624b 100644 (file)
@@ -1,3 +1,7 @@
+2000-08-03  Zack Weinberg  <zack@wolery.cumb.org>
+
+       * gcc.dg/cpp/20000625-2.c: Don't expect a warning on line 4.
+
 Thu Aug  3 01:46:33 2000  Jeffrey A Law  (law@cygnus.com)
 
        * gcc.c-torture/compile/20000803-1.c: New test.
index 437d8654f5864c2b123bf85158594f17a29bc731..d2e17cb19437256906fcd66db4e3fbde34fafc33 100644 (file)
@@ -2,7 +2,6 @@
 /* { dg-do run } */
 
 #define symbol_version(name, version) name##@##version
-/* { dg-warning "nothing can be pasted" "" { target *-*-* } 4 } */
 #define str(x) xstr(x)
 #define xstr(x) #x