diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2010-01-22 21:36:53 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2010-01-22 21:36:53 +0000 |
commit | a8be02b655b76e4dbe776b0c62bc3c450dc6feab (patch) | |
tree | ac84ecb65dfd214bc6a8ec10182f28ace2d167e2 | |
parent | 5b4ec636637c9d876102240127cc0dca9280e83a (diff) |
ui64, etc. are valid VS suffixes.
Fixes radar 7562363.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94224 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Lex/LiteralSupport.cpp | 2 | ||||
-rw-r--r-- | test/Lexer/constants-ms.c | 15 |
2 files changed, 15 insertions, 2 deletions
diff --git a/lib/Lex/LiteralSupport.cpp b/lib/Lex/LiteralSupport.cpp index 5cd5497505..004e6755e5 100644 --- a/lib/Lex/LiteralSupport.cpp +++ b/lib/Lex/LiteralSupport.cpp @@ -375,7 +375,7 @@ NumericLiteralParser(const char *begin, const char *end, continue; // Success. case 'i': if (PP.getLangOptions().Microsoft) { - if (isFPConstant || isUnsigned || isLong || isLongLong) break; + if (isFPConstant || isLong || isLongLong) break; // Allow i8, i16, i32, i64, and i128. if (s + 1 != ThisTokEnd) { diff --git a/test/Lexer/constants-ms.c b/test/Lexer/constants-ms.c index 5b3f826119..02d5594d5b 100644 --- a/test/Lexer/constants-ms.c +++ b/test/Lexer/constants-ms.c @@ -7,6 +7,19 @@ __int64 x5 = 0x42i64; __int64 x4 = 70000000i128; __int64 y = 0x42i64u; // expected-error {{invalid suffix}} -__int64 w = 0x43ui64; // expected-error {{invalid suffix}} +__int64 w = 0x43ui64; __int64 z = 9Li64; // expected-error {{invalid suffix}} __int64 q = 10lli64; // expected-error {{invalid suffix}} + +// radar 7562363 +#define ULLONG_MAX 0xffffffffffffffffui64 +#define UINT 0xffffffffui32 +#define USHORT 0xffffui8 +#define UCHAR 0xffffffffui8 + +void a() { + unsigned long long m = ULLONG_MAX; + unsigned int n = UINT; + unsigned short s = USHORT; + unsigned char c = UCHAR; +} |