re PR preprocessor/29612 (gcc --save-temps does not give "multi-character character constant" error)

PR preprocessor/29612
	* directives.c (do_linemarker): Set pfile->buffer->sysp always, not
	only when new_sysp is non-zero.

	* gcc.dg/cpp/pr29612-1.c: New test.
	* gcc.dg/cpp/pr29612-2.c: New test.

From-SVN: r120257
This commit is contained in:
Jakub Jelinek 2006-12-29 09:15:08 +01:00 committed by Jakub Jelinek
parent 311c6da40f
commit 9d30f270db
5 changed files with 46 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2006-12-29 Jakub Jelinek <jakub@redhat.com>
PR preprocessor/29612
* gcc.dg/cpp/pr29612-1.c: New test.
* gcc.dg/cpp/pr29612-2.c: New test.
2006-12-28 Paul Thomas <pault@gcc.gnu.org>
PR fortran/30034

View File

@ -0,0 +1,15 @@
/* PR preprocessor/29612 */
/* { dg-do compile } */
/* { dg-options "" } */
# 6 "pr29612-1.c"
int foo (void) { return 'ab'; } /* { dg-warning "multi-character" } */
# 1 "foo.h" 1 3
int bar (void) { return 'ab'; } /* No warning in system header. */
# 14 "pr29612-1.c" 2
int baz (void) { return 'ab'; } /* { dg-warning "multi-character" } */

View File

@ -0,0 +1,18 @@
/* PR preprocessor/29612 */
/* { dg-do preprocess } */
/* { dg-options "-Wtraditional -fno-show-column" } */
# 6 "pr29612-2.c"
#if 1U /* { dg-warning "traditional C rejects" "numeric constant suffix" } */
#endif
# 1 "foo.h" 1 3
#if 1U
#endif /* No warning in system header. */
# 16 "pr29612-2.c" 2
#if 1U /* { dg-warning "traditional C rejects" "numeric constant suffix" } */
#endif

View File

@ -1,3 +1,9 @@
2006-12-29 Jakub Jelinek <jakub@redhat.com>
PR preprocessor/29612
* directives.c (do_linemarker): Set pfile->buffer->sysp always, not
only when new_sysp is non-zero.
2006-12-28 Tom Tromey <tromey@redhat.com>
PR preprocessor/30001:

View File

@ -942,8 +942,8 @@ do_linemarker (cpp_reader *pfile)
flag = read_flag (pfile, flag);
if (flag == 4)
new_sysp = 2;
pfile->buffer->sysp = new_sysp;
}
pfile->buffer->sysp = new_sysp;
check_eol (pfile);
}