From 7168133a372e15373f3687d9b5e01ce24a954de9 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Tue, 1 Mar 2016 01:02:49 +0000 Subject: PR preprocessor/69985: fix ICE with long lines in -Wformat gcc/testsuite/ChangeLog: PR preprocessor/69985 * gcc.dg/cpp/pr69985.c: New test case. libcpp/ChangeLog: PR preprocessor/69985 (linemap_position_for_loc_and_offset): Rename param from "offset" to "column_offset". Right-shift the column_offset by m_range_bits of the pertinent ordinary map whenever offsetting a source_location. For clarity, offset the column by the column offset, rather than the other way around. From-SVN: r233836 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/cpp/pr69985.c | 7 +++++++ 2 files changed, 12 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/cpp/pr69985.c (limited to 'gcc') diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 3743d34..50c4aa9 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-02-29 David Malcolm + + PR preprocessor/69985 + * gcc.dg/cpp/pr69985.c: New test case. + 2016-02-29 Jeff Law PR tree-optimization/70005 diff --git a/gcc/testsuite/gcc.dg/cpp/pr69985.c b/gcc/testsuite/gcc.dg/cpp/pr69985.c new file mode 100644 index 0000000..28f17e9 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/pr69985.c @@ -0,0 +1,7 @@ +/* { dg-options "-Wformat" } */ +extern int printf (const char *__restrict __format, ...); +void test (void) +{ + /* A very long line, so that we start a new line map. */ + printf ("%llu01233456789012334567890123345678901233456789012334567890123345678901233456789012334567890123345678901233456789012334567890123345678901233456789"); /* { dg-warning "15: format .%llu. expects a matching" } */ +} -- cgit v1.1