diff options
author | David Majnemer <david.majnemer@gmail.com> | 2015-03-06 18:04:22 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2015-03-06 18:04:22 +0000 |
commit | be09e8e5cf8495fc81cee39de028d6f62451fc03 (patch) | |
tree | 13d882289ed08a07418cc81a3fcf9a8946c3befa /clang/lib/Sema/SemaExpr.cpp | |
parent | ef648462d26c62898e338806c405a937d9f9bb1d (diff) | |
download | bcm5719-llvm-be09e8e5cf8495fc81cee39de028d6f62451fc03.tar.gz bcm5719-llvm-be09e8e5cf8495fc81cee39de028d6f62451fc03.zip |
Sema: The i8 suffix should yield a literal of type char
We would make i8 literals turn into signed char instead of char. This
is incompatible with MSVC.
This fixes PR22824.
llvm-svn: 231494
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index 84315be781f..a793d45da4e 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -3324,6 +3324,9 @@ ExprResult Sema::ActOnNumericConstant(const Token &Tok, Scope *UDLScope) { Diag(Tok.getLocation(), diag::err_int128_unsupported); Width = MaxWidth; Ty = Context.getIntMaxType(); + } else if (Literal.MicrosoftInteger == 8 && !Literal.isUnsigned) { + Width = 8; + Ty = Context.CharTy; } else { Width = Literal.MicrosoftInteger; Ty = Context.getIntTypeForBitwidth(Width, |