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

--- Comment #11 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
This should be fixed in libcpp, probably in lex.c, but maybe other places also.
A good testcase to start with would be:

/* ñ /* */
/* a /* */

cc1 -Wcomment

prog.cc:1:7: warning: "/*" within comment [-Wcomment]
 /* ñ /* */
       ^
prog.cc:2:6: warning: "/*" within comment [-Wcomment]
 /* a /* */
      ^

Both locations should point to column 6. Look for places where column info is
converted to source_location (linemap_position_for_column or
linemap_position_for_line_and_colum). Figure out where the column info got the
wrong value. Use something like wcwidth() to measure the width of non-ASCII
characters and get the right width of 'ñ'.

Unfortunately, GCC 6 seems to be broken for the above testcase
(https://gcc.gnu.org/PR69664). Revision 229665 seems fine.

Reply via email to