Commit 0879540b by Neil Booth Committed by Neil Booth

cpptrad.c: Update comment.

	* 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
parent ba57a9c0
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.
......
......@@ -491,7 +491,8 @@ scan_out_logical_line (pfile, macro)
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.
......
......@@ -10,3 +10,11 @@
#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
......@@ -4,6 +4,7 @@
/* { dg-do run } */
#define f(x, y) "x y"
#define g(x) x
extern void abort (void);
......@@ -20,5 +21,10 @@ foo
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;
}
......@@ -14,3 +14,12 @@ f(f,f,f,f,f,f,f,f,f) /* { dg-bogus "detected recursion" } */
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" } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment