[cfe-commits] r94224 - in /cfe/trunk: lib/Lex/LiteralSupport.cpp test/Lexer/constants-ms.c

Fariborz Jahanian fjahanian at apple.com
Fri Jan 22 13:36:54 PST 2010


Author: fjahanian
Date: Fri Jan 22 15:36:53 2010
New Revision: 94224

URL: http://llvm.org/viewvc/llvm-project?rev=94224&view=rev
Log:
ui64, etc. are valid VS suffixes.
Fixes radar 7562363.

Modified:
    cfe/trunk/lib/Lex/LiteralSupport.cpp
    cfe/trunk/test/Lexer/constants-ms.c

Modified: cfe/trunk/lib/Lex/LiteralSupport.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/LiteralSupport.cpp?rev=94224&r1=94223&r2=94224&view=diff

==============================================================================
--- cfe/trunk/lib/Lex/LiteralSupport.cpp (original)
+++ cfe/trunk/lib/Lex/LiteralSupport.cpp Fri Jan 22 15:36:53 2010
@@ -375,7 +375,7 @@
       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) {

Modified: cfe/trunk/test/Lexer/constants-ms.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Lexer/constants-ms.c?rev=94224&r1=94223&r2=94224&view=diff

==============================================================================
--- cfe/trunk/test/Lexer/constants-ms.c (original)
+++ cfe/trunk/test/Lexer/constants-ms.c Fri Jan 22 15:36:53 2010
@@ -7,6 +7,19 @@
 __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;
+}





More information about the cfe-commits mailing list