public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "bernd.edlinger at hotmail dot de" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug preprocessor/99446] [11 Regression] ICE in linemap_position_for_loc_and_offset, at libcpp/line-map.c:1005 since r11-6325 Date: Mon, 12 Apr 2021 10:11:55 +0000 [thread overview] Message-ID: <bug-99446-4-0H1i6pUxQS@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-99446-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99446 Bernd Edlinger <bernd.edlinger at hotmail dot de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bernd.edlinger at hotmail dot de --- Comment #7 from Bernd Edlinger <bernd.edlinger at hotmail dot de> --- Hmm, I don't fully understand what's the reason why the assertion fires here. ... but what's apparently wrong here, is the location before the EOF is in a different file. While it was intended to show the line above the end-of-file, it was likely not intended to show the last token in a different include file? So something like that fixes the test case: diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 59adac4..99026f4 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -668,7 +668,8 @@ cp_lexer_new_main (void) + lexer->buffer->length () - 1; - if (lexer->buffer->length () != 1) + if (lexer->buffer->length () != 1 + && LOCATION_FILE (tok[-1].location) == LOCATION_FILE(tok[0].location)) { /* Set the EOF token's location to be the just after the previous token's range. That way 'at-eof' diagnostics point at something
next prev parent reply other threads:[~2021-04-12 10:11 UTC|newest] Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-03-07 10:27 [Bug preprocessor/99446] New: [11 Regression] ICE in linemap_position_for_loc_and_offset, at libcpp/line-map.c:1005 doko at debian dot org 2021-03-08 8:44 ` [Bug preprocessor/99446] " marxin at gcc dot gnu.org 2021-03-08 8:58 ` rguenth at gcc dot gnu.org 2021-03-17 11:51 ` sbergman at redhat dot com 2021-03-17 15:33 ` sbergman at redhat dot com 2021-04-08 13:02 ` rguenth at gcc dot gnu.org 2021-04-08 13:03 ` rguenth at gcc dot gnu.org 2021-04-08 13:05 ` rguenth at gcc dot gnu.org 2021-04-08 13:20 ` [Bug preprocessor/99446] [11 Regression] ICE in linemap_position_for_loc_and_offset, at libcpp/line-map.c:1005 since r11-6325 jakub at gcc dot gnu.org 2021-04-12 10:11 ` bernd.edlinger at hotmail dot de [this message] 2021-04-12 13:16 ` nathan at gcc dot gnu.org 2021-04-12 13:46 ` bernd.edlinger at hotmail dot de 2021-04-12 14:11 ` nathan at gcc dot gnu.org 2021-04-13 12:07 ` cvs-commit at gcc dot gnu.org 2021-04-13 12:08 ` nathan at gcc dot gnu.org 2021-04-18 12:44 ` bernd.edlinger at hotmail dot de
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-99446-4-0H1i6pUxQS@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).