Commit f373b44d by Tom Tromey Committed by Tom Tromey

re PR preprocessor/30805 (Internal compiler error when using "x##,##__VA_ARGS__" in macro)

libcpp
	PR preprocessor/30805:
	* macro.c (paste_tokens): Handle padding token.
	(paste_tokens): Don't abort unless padding has PASTE_LEFT flag.
gcc/testsuite
	PR preprocessor/30805:
	* gcc.dg/cpp/pr30805.c: New file.

From-SVN: r129827
parent 233a722b
2007-11-01 Tom Tromey <tromey@redhat.com>
PR preprocessor/30805:
* gcc.dg/cpp/pr30805.c: New file.
2007-11-01 Janis Johnson <janis187@us.ibm.com>
PR testsuite/25352
/* PR preprocessor/30805 - ICE while token pasting. */
/* { dg-do preprocess } */
#define A(x,...) x##,##__VA_ARGS__
A(1)
2007-11-01 Tom Tromey <tromey@redhat.com>
PR preprocessor/30805:
* macro.c (paste_tokens): Handle padding token.
(paste_tokens): Don't abort unless padding has PASTE_LEFT flag.
2007-10-31 Tom Tromey <tromey@redhat.com>
PR preprocessor/30786:
......
......@@ -451,6 +451,8 @@ paste_tokens (cpp_reader *pfile, const cpp_token **plhs, const cpp_token *rhs)
false doesn't work, since we want to clear the PASTE_LEFT flag. */
if ((*plhs)->type == CPP_DIV && rhs->type != CPP_EQ)
*end++ = ' ';
/* In one obscure case we might see padding here. */
if (rhs->type != CPP_PADDING)
end = cpp_spell_token (pfile, rhs, end, false);
*end = '\n';
......@@ -514,8 +516,10 @@ paste_all_tokens (cpp_reader *pfile, const cpp_token *lhs)
rhs = *FIRST (context).ptoken++;
if (rhs->type == CPP_PADDING)
{
if (rhs->flags & PASTE_LEFT)
abort ();
}
if (!paste_tokens (pfile, &lhs, rhs))
break;
}
......
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