public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/110655] New: incorrect position of indicator in error message
@ 2023-07-13 11:07 drepper.fsp+rhbz at gmail dot com
  2023-07-13 15:44 ` [Bug preprocessor/110655] " pinskia at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: drepper.fsp+rhbz at gmail dot com @ 2023-07-13 11:07 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110655

            Bug ID: 110655
           Summary: incorrect position of indicator in error message
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: drepper.fsp+rhbz at gmail dot com
  Target Milestone: ---

Take this source and run it through a trunk version or earlier of the C++
frontend.  

#include <stdio.h>
int main() {
  puts(“hello world”);
  return 0;
}

This is the same code as in BZ 110654 but shows a different, frontend-specific
problem.

The output is:

u.c:3:8: error: extended character “ is not valid in an identifier
    3 |   puts(“hello world”);
      |        ^
u.c:3:15: error: extended character ” is not valid in an identifier
    3 |   puts(“hello world”);
      |               ^
u.c: In function ‘int main()’:
u.c:3:8: error: ‘“hello’ was not declared in this scope
    3 |   puts(“hello world”);
      |        ^~~~~~


The problem is the second error message.  It should report the U201d character
at what would be the end of the string but it column indicator points to the
second word in the string.

If you want to go further down the rathole of this example, the first error
message says that U201c is not valid in an identifer which is of course
correct.  But then gcc neverthess adds it in front of the supposed identifier
which extends to the end of the first word of the string.  See the last error
message which says that “hello is not a valid identifier.  This is
inconsistent.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug preprocessor/110655] incorrect position of indicator in error message
  2023-07-13 11:07 [Bug c++/110655] New: incorrect position of indicator in error message drepper.fsp+rhbz at gmail dot com
@ 2023-07-13 15:44 ` pinskia at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-07-13 15:44 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110655

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c++                         |preprocessor

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
It points to the start of the identifier rather than the position of the
character ....

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-07-13 15:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-13 11:07 [Bug c++/110655] New: incorrect position of indicator in error message drepper.fsp+rhbz at gmail dot com
2023-07-13 15:44 ` [Bug preprocessor/110655] " pinskia at gcc dot gnu.org

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).