diff options
author | Nathan Sidwell <nathan@acm.org> | 2021-04-13 05:03:19 -0700 |
---|---|---|
committer | Nathan Sidwell <nathan@acm.org> | 2021-04-13 05:07:23 -0700 |
commit | 4acb3af3669db4ca79ffc97cd615fcea205bcccb (patch) | |
tree | 195554064da12db8edf29a3979c14006d5503afe /gcc | |
parent | f6ba5d039f988babdd99b5cdfb4557c380e57d69 (diff) | |
download | gcc-4acb3af3669db4ca79ffc97cd615fcea205bcccb.zip gcc-4acb3af3669db4ca79ffc97cd615fcea205bcccb.tar.gz gcc-4acb3af3669db4ca79ffc97cd615fcea205bcccb.tar.bz2 |
preprocessor: Fix column adjustment [PR 99446]
This ICE was because when adjusting a column offset we could advance
into a linemap for a different file. We only checked the next line
map was not for a line further advanced in any file, forgetting that
it could be for an earlier line in a different file. The testcase
needed adjusting as column 512 was unrepresentable, once that was
taken into consideration.
PR preprocessor/99446
libcpp/
* line-map.c (line-map.c): Do not advance to linemaps for
different files.
gcc/testsuite/
* g++.dg/diagnostic/pr72803.C: Adjust expected column.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/g++.dg/diagnostic/pr72803.C | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/testsuite/g++.dg/diagnostic/pr72803.C b/gcc/testsuite/g++.dg/diagnostic/pr72803.C index 0a9a390..ca522b7 100644 --- a/gcc/testsuite/g++.dg/diagnostic/pr72803.C +++ b/gcc/testsuite/g++.dg/diagnostic/pr72803.C @@ -5,5 +5,6 @@ class test { // The line directive appears to be necessary to trigger the ICE // { dg-error "style of line directive is a GCC extension" "" { target *-*-* } .-2 } -/* Verify that we get the correct line and column for the diagnostic. */ -// { dg-error "512: expected .;. after class definition" "" { target *-*-* } 3 } +/* Verify that we get the best line and column for the diagnostic. + 512 is not representable in the line-maps created for this test. */ +// { dg-error "511: expected .;. after class definition" "" { target *-*-* } 3 } |