(rescan): Accept # as command inside macro args, etc.
authorRichard Stallman <rms@gnu.org>
Wed, 11 Nov 1992 05:41:43 +0000 (05:41 +0000)
committerRichard Stallman <rms@gnu.org>
Wed, 11 Nov 1992 05:41:43 +0000 (05:41 +0000)
if an actual newline at the same level precedes.

From-SVN: r2741

gcc/cccp.c

index c3487fdd5b99361fee3dcf0b30cc9f85b1058f01..3c8882087d2b06243cda6810d9746bd8c8892b15 100644 (file)
@@ -2260,9 +2260,14 @@ do { ip = &instack[indepth];             \
        }
       }
 
-      /* Recognize preprocessor directives only when reading
-        directly from a file.  */
-      if (ip->fname == 0)
+      /* If this is expanding a macro definition, don't recognize
+        preprocessor directives.  */
+      if (ip->macro != 0)
+       goto randomchar;
+      /* If this is expand_into_temp_buffer, recognize them
+        only after an actual newline at this level,
+        not at the beginning of the input level.  */
+      if (ip->fname == 0 && beg_of_line == ip->buf)
        goto randomchar;
       if (ident_length)
        goto specialchar;