From c2043f486036f77a01c0e1057ea67be8a680caf6 Mon Sep 17 00:00:00 2001 From: David Majnemer Date: Wed, 18 Feb 2015 02:28:13 +0000 Subject: [PATCH] Sema: size_t is available in C when -fms-compatibility is enabled git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@229616 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/Sema.cpp | 5 +++-- test/Sema/MicrosoftCompatibility.c | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/Sema/Sema.cpp b/lib/Sema/Sema.cpp index 21e86a11f5..5170c244bb 100644 --- a/lib/Sema/Sema.cpp +++ b/lib/Sema/Sema.cpp @@ -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); diff --git a/test/Sema/MicrosoftCompatibility.c b/test/Sema/MicrosoftCompatibility.c index a193b26b42..010033bba0 100644 --- a/test/Sema/MicrosoftCompatibility.c +++ b/test/Sema/MicrosoftCompatibility.c @@ -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; -- 2.50.1