Fix C++0x narrowing errors when char is unsigned.

In the case of EDInstInfo, this would actually cause a bug when -1 became 255
and was then compared >=0 in llvm-mc/Disassembler.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138825 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jeffrey Yasskin
2011-08-30 20:53:29 +00:00
parent 2ac6b01854
commit cda2a146d1
6 changed files with 7 additions and 7 deletions

View File

@ -63,7 +63,7 @@ TEST_F(MDStringTest, PrintingSimple) {
// Test printing of MDString with non-printable characters.
TEST_F(MDStringTest, PrintingComplex) {
char str[5] = {0, '\n', '"', '\\', -1};
char str[5] = {0, '\n', '"', '\\', (char)-1};
MDString *s = MDString::get(Context, StringRef(str+0, 5));
std::string Str;
raw_string_ostream oss(Str);