Sema: Predefine size_t in MSVC Compatibility mode

MSVC defines size_t without any explicit declarations.  This change
allows us to be compatible with TUs that depend on this declaration
appearing from nowhere.

llvm-svn: 199190
This commit is contained in:
David Majnemer 2014-01-14 06:19:35 +00:00
parent 899b4f3624
commit 1de36917d3
2 changed files with 3 additions and 0 deletions

View File

@ -182,6 +182,8 @@ void Sema::Initialize() {
if (IdResolver.begin(&Context.Idents.get("type_info")) == IdResolver.end())
PushOnScopeChains(Context.buildImplicitRecord("type_info", TTK_Class),
TUScope);
addImplicitTypedef("size_t", Context.getSizeType());
}
// Initialize predefined OpenCL types.

View File

@ -24,6 +24,7 @@ void test()
namespace ms_predefined_types {
// ::type_info is a built-in forward class declaration.
void f(const type_info &a);
void f(size_t);
}