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 | 8c6c0b6a1f898eb1b2d7de7d855df27a5cf50d68 (patch) | |
| tree | f2859b838be70d198d316fb047e7e0e0faa79bb2 | |
| parent | 10b204675075129bcc8c9a020731fe1e314611d6 (diff) | |
| download | bcm5719-llvm-8c6c0b6a1f898eb1b2d7de7d855df27a5cf50d68.tar.gz bcm5719-llvm-8c6c0b6a1f898eb1b2d7de7d855df27a5cf50d68.zip | |
ui64, etc. are valid VS suffixes.
Fixes radar 7562363.
llvm-svn: 94224
| -rw-r--r-- | clang/lib/Lex/LiteralSupport.cpp | 2 | ||||
| -rw-r--r-- | clang/test/Lexer/constants-ms.c | 15 |
2 files changed, 15 insertions, 2 deletions
diff --git a/clang/lib/Lex/LiteralSupport.cpp b/clang/lib/Lex/LiteralSupport.cpp index 5cd54975055..004e6755e5f 100644 --- a/clang/lib/Lex/LiteralSupport.cpp +++ b/clang/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/clang/test/Lexer/constants-ms.c b/clang/test/Lexer/constants-ms.c index 5b3f8261197..02d5594d5bd 100644 --- a/clang/test/Lexer/constants-ms.c +++ b/clang/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; +} |

