Commit 5e4df1ae by Zack Weinberg Committed by Zack Weinberg

cpphash.c (special_symbol): When expanding __LINE__, use the top file buffer, not the top buffer.

1999-04-09 22:58 -0400  Zack Weinberg  <zack@rabi.columbia.edu>
	* cpphash.c (special_symbol): When expanding __LINE__, use the
	top file buffer, not the top buffer.

From-SVN: r26319
parent 2622b947
1999-04-09 22:58 -0400 Zack Weinberg <zack@rabi.columbia.edu>
* cpphash.c (special_symbol): When expanding __LINE__, use the
top file buffer, not the top buffer.
Fri Apr 9 13:41:04 1999 Jim Wilson <wilson@cygnus.com>
* Makefile.in (check-g++, check-gcc, check-g77, check-objc): Add
......
......@@ -991,7 +991,7 @@ special_symbol (hp, pfile)
case T_SPECLINE:
{
long line;
cpp_buf_line_and_col (CPP_BUFFER (pfile), &line, NULL);
cpp_buf_line_and_col (cpp_file_buffer (pfile), &line, NULL);
CPP_RESERVE (pfile, 10);
sprintf (CPP_PWRITTEN (pfile), "%ld", line);
......
/* Test that __LINE__ works when embedded in a macro. */
/* { dg-do run } */
#define foo() bar(__LINE__)
void
bar(int x)
{
if (x != 16)
abort();
}
int
main(void)
{
foo(); /* This is line 16 */
return 0;
}
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