[llvm-bugs] [Bug 31869] New: Incorrect encoding error only shows for wide chars

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Feb 5 00:55:04 PST 2017


https://llvm.org/bugs/show_bug.cgi?id=31869

            Bug ID: 31869
           Summary: Incorrect encoding error only shows for wide chars
           Product: clang
           Version: 4.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: jvapen at gmail.com
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 17939
  --> https://llvm.org/bugs/attachment.cgi?id=17939&action=edit
Reproduction

Found in clang-cl 4.0-rc1 while trying to compile MSVC codebase with clang.

In attachment, one can find 2 functions with the same content, once for
std::string, once for std::wstring.
The first one uses 'ä' while the second uses L'ä'.

The first one compiles, while the second doesn't. This second one gives:
'illegal character encoding in character literal'.

As these 2 statements are copy-paste, I, as a user, would expect either a
compilation error for both or for none.

On top of this, it would be nice if clang could also suggest how to rewrite
this character using its Unicode representation (\uffff or \Uffffffff).

See attachment for a reproduction

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20170205/ca487482/attachment.html>


More information about the llvm-bugs mailing list