<rdar://problem/11146929>

Enabling support for the wchar_t type.
Without the proper language option setup, clang's ASTContexts will be configured to have wchar_t == int
This patch enables the correct options to make sure that we report wchar_t as itself
Added a test case to make sure we do not regress 

Adding files missing from the previous commit

llvm-svn: 172039
This commit is contained in:
Enrico Granata 2013-01-10 02:37:22 +00:00
parent b4e2e93c61
commit c921e34c81
2 changed files with 3 additions and 0 deletions

View File

@ -266,6 +266,8 @@ ParseLangArgs
Opts.GNUInline = !Std.isC99();
Opts.HexFloats = Std.hasHexFloats();
Opts.ImplicitInt = Std.hasImplicitInt();
Opts.WChar = true;
// OpenCL has some additional defaults.
if (LangStd == LangStandard::lang_opencl) {

View File

@ -58,6 +58,7 @@ ClangASTType::GetTypeNameForQualType (clang::ASTContext *ast, clang::QualType qu
clang::PrintingPolicy printing_policy (ast->getPrintingPolicy());
printing_policy.SuppressTagKeyword = true;
printing_policy.LangOpts.WChar = true;
const clang::TypedefType *typedef_type = qual_type->getAs<clang::TypedefType>();
if (typedef_type)
{