* cpptrad.c: Update comment.
testsuite:
* gcc.dg/cpp/trad/directive.c: Add test.
* gcc.dg/cpp/trad/macroargs.c: Add test.
* gcc.dg/cpp/trad/recurse-3.c: Add tests.
From-SVN: r55196
+2002-07-03 Neil Booth <neil@daikokuya.co.uk>
+
+ * cpptrad.c: Update comment.
+
2002-07-02 Neil Booth <neil@daikokuya.co.uk>
* doc/cpp.texi: Update for traditional preprocessing changes.
if ((lex_state == ls_fun_open || lex_state == ls_fun_close)
&& !pfile->state.in_directive)
{
- /* Newlines in arguments become a space. */
+ /* Newlines in arguments become a space, but we don't
+ clear any in-progress quote. */
if (lex_state == ls_fun_close)
out[-1] = ' ';
continue;
+2002-07-03 Neil Booth <neil@daikokuya.co.uk>
+
+ * gcc.dg/cpp/trad/directive.c: Add test.
+ * gcc.dg/cpp/trad/macroargs.c: Add test.
+ * gcc.dg/cpp/trad/recurse-3.c: Add tests.
+
2002-07-02 Neil Booth <neil@daikokuya.co.uk>
* gcc.dg/cpp/cmdlne-M.c: New test.
#if 0 /* { dg-bogus "unterminated" } */
#wrong /* { dg-error "invalid" } */
+
+#define foo 2
+#define bar + 3
+#define foobar 6
+
+#if foo/**/bar != 5
+# error Comments in directive is a separator /* { dg-bogus "error" } */
+#endif
/* { dg-do run } */
#define f(x, y) "x y"
+#define g(x) x
extern void abort (void);
if (strcmp (str1, str2))
abort ();
+ /* Verify that quoted state is preserved over a newline. */
+ if (strcmp (g /* { dg-bogus "unterminated 2" } */ ("1
+, 2"), "1 , 2"))
+ abort ();
+
return 0;
}
sources so let's try it too. */
#define foo(x,y) bar (x (y,0), y)
foo (foo, baz); /* { dg-bogus "detected recursion" } */
+
+#define mac mac/**/ro
+mac /* { dg-bogus "detected recursion" } */
+
+#define mac2 mac2
+"mac2" /* { dg-bogus "detected recursion" } */
+
+#define macro "macro
+macro mac2 /* { dg-bogus "detected recursion" } */