]> granicus.if.org Git - clang/commitdiff
Sema: size_t is available in C when -fms-compatibility is enabled
authorDavid Majnemer <david.majnemer@gmail.com>
Wed, 18 Feb 2015 02:28:13 +0000 (02:28 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Wed, 18 Feb 2015 02:28:13 +0000 (02:28 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@229616 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/Sema.cpp
test/Sema/MicrosoftCompatibility.c

index 21e86a11f5dd85be40df1586fc2cb065db1a1971..5170c244bbfe34e5a4ee737d56bf45ac5e8f2872 100644 (file)
@@ -193,8 +193,9 @@ void Sema::Initialize() {
   }
 
   // Initialize Microsoft "predefined C++ types".
-  if (PP.getLangOpts().MSVCCompat && PP.getLangOpts().CPlusPlus) {
-    if (IdResolver.begin(&Context.Idents.get("type_info")) == IdResolver.end())
+  if (PP.getLangOpts().MSVCCompat) {
+    if (PP.getLangOpts().CPlusPlus &&
+        IdResolver.begin(&Context.Idents.get("type_info")) == IdResolver.end())
       PushOnScopeChains(Context.buildImplicitRecord("type_info", TTK_Class),
                         TUScope);
 
index a193b26b422316b8137b78216c3b795f3a47ed59..010033bba00c622d99d6780a14f60759bcb90fe3 100644 (file)
@@ -21,3 +21,5 @@ struct __declspec(aligned) S2 {}; /* expected-warning {{__declspec attribute 'al
 struct __declspec(appdomain) S3 {}; /* expected-warning {{__declspec attribute 'appdomain' is not supported}} */
 
 __declspec(__noreturn__) void f7(void); /* expected-warning {{__declspec attribute '__noreturn__' is not supported}} */
+
+size_t x;