]> granicus.if.org Git - clang/commit
clang-cl: Support MSVC2015's /validate-charset flag.
authorNico Weber <nicolasweber@gmx.de>
Fri, 26 Aug 2016 21:51:14 +0000 (21:51 +0000)
committerNico Weber <nicolasweber@gmx.de>
Fri, 26 Aug 2016 21:51:14 +0000 (21:51 +0000)
commit4fef27d8c527b0da6135831dbb6cbe45565b5d44
tree21b1b18f27eb5ca471d6754b76be4fc8b4894d81
parentb5f10f253e876c7055d860a7fa891143c926096e
clang-cl: Support MSVC2015's /validate-charset flag.

Clang always assumes that files are utf-8. If an invalidly encoded character is
used in an identifier, clang always errors. If it's used in a character
literal, clang warns Winvalid-source-encoding (on by default). Clang never
checks the encoding of things in comments (adding this seems like a nice
feature if it doesn't impact performance).

For cl.exe /utf-8 (which enables /validate-charset), if a bad character is used
in an identifier, it emits both an error and a warning. If it's used in a
literal or a comment, it emits a warning.

So mapping /validate-charset to -Winvalid-source-encoding seems like a fairly
decent fit.

https://reviews.llvm.org/D23945

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@279872 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Driver/CLCompatOptions.td
test/Driver/cl-options.c