Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

Unintuitive column number when source file contains UTF-8 BOM #21143

Open Quuxplusone opened 9 years ago

Quuxplusone commented 9 years ago
Bugzilla Link PR21144
Status NEW
Importance P normal
Reported by xda@cypress.com
Reported on 2014-10-02 17:18:49 -0700
Last modified on 2017-06-01 03:08:49 -0700
Version 3.7
Hardware PC Windows NT
CC Erik.Verbruggen@Me.com, ivan.donchevskii@qt.io, llvm-bugs@lists.llvm.org
Fixed by commit(s)
Attachments utf8.zip (289 bytes, application/octet-stream)
main.cpp (90 bytes, text/plain)
main.cpp (91 bytes, text/plain)
Blocks
Blocked by
See also
Created attachment 13127
UTF-8 and Latin-1 source files

When there is a diagnostic on the first line of a file with a UTF-8 BOM, the
column number is 3 characters greater than expected:

C:\Program Files (x86)\LLVM\bin>clang -W -fsyntax-only
C:\Users\xda\Desktop\utf8.c
C:\Users\xda\Desktop\utf8.c:1:5: error: "whoops!"
<U+FEFF>#error "whoops!"
         ^
1 error generated.

C:\Program Files (x86)\LLVM\bin>clang -W -fsyntax-only
C:\Users\xda\Desktop\lat1.c
C:\Users\xda\Desktop\lat1.c:1:2: error: "whoops!"
#error "whoops!"
 ^
1 error generated.
Quuxplusone commented 9 years ago

Attached utf8.zip (289 bytes, application/octet-stream): UTF-8 and Latin-1 source files

Quuxplusone commented 7 years ago

Attached main.cpp (90 bytes, text/plain): wrong column number

Quuxplusone commented 7 years ago

Attached main.cpp (91 bytes, text/plain): file with broken diagnostics