From 44714d8ce1ec1b5ac5dc9a2ed3d57713b9253e81 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Mon, 8 Feb 2016 17:33:45 +0000 Subject: PR preprocessor/69664: fix rich_location::override_column gcc/testsuite/ChangeLog: PR preprocessor/69664 * gcc.dg/cpp/trad/comment-2.c: Add expected column number. * gcc.dg/cpp/warn-comments.c: Likewise. libcpp/ChangeLog: PR preprocessor/69664 * errors.c (cpp_diagnostic_with_line): Only call rich_location::override_column if the column is non-zero. * line-map.c (rich_location::override_column): Update columns within m_ranges[0]. Add assertions to verify that doing so is sane. From-SVN: r233223 --- gcc/testsuite/ChangeLog | 6 ++++++ gcc/testsuite/gcc.dg/cpp/trad/comment-2.c | 2 +- gcc/testsuite/gcc.dg/cpp/warn-comments.c | 4 ++-- 3 files changed, 9 insertions(+), 3 deletions(-) (limited to 'gcc') diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b30f01d..82521ec 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2016-02-08 David Malcolm + + PR preprocessor/69664 + * gcc.dg/cpp/trad/comment-2.c: Add expected column number. + * gcc.dg/cpp/warn-comments.c: Likewise. + 2016-02-08 Marek Polacek PR c++/69688 diff --git a/gcc/testsuite/gcc.dg/cpp/trad/comment-2.c b/gcc/testsuite/gcc.dg/cpp/trad/comment-2.c index 8d54e3a..310f569 100644 --- a/gcc/testsuite/gcc.dg/cpp/trad/comment-2.c +++ b/gcc/testsuite/gcc.dg/cpp/trad/comment-2.c @@ -8,4 +8,4 @@ /* - /* { dg-warning "within comment" } */ + /* { dg-warning "2: within comment" } */ diff --git a/gcc/testsuite/gcc.dg/cpp/warn-comments.c b/gcc/testsuite/gcc.dg/cpp/warn-comments.c index 1cdf75c..bbe2821 100644 --- a/gcc/testsuite/gcc.dg/cpp/warn-comments.c +++ b/gcc/testsuite/gcc.dg/cpp/warn-comments.c @@ -1,7 +1,7 @@ // { dg-do preprocess } // { dg-options "-std=gnu99 -fdiagnostics-show-option -Wcomments" } -/* /* */ // { dg-warning "\"\.\*\" within comment .-Wcomment." } +/* /* */ // { dg-warning "4: \"\.\*\" within comment .-Wcomment." } // \ - // { dg-warning "multi-line comment .-Wcomment." "multi-line" { target *-*-* } 6 } + // { dg-warning "1: multi-line comment .-Wcomment." "multi-line" { target *-*-* } 6 } -- cgit v1.1