]> granicus.if.org Git - clang/commit
Add support for __wchar_t in -fms-extensions mode.
authorHans Wennborg <hans@hanshq.net>
Fri, 10 May 2013 10:08:40 +0000 (10:08 +0000)
committerHans Wennborg <hans@hanshq.net>
Fri, 10 May 2013 10:08:40 +0000 (10:08 +0000)
commit15f92bad58c8650b1306729744b1a1230197497a
tree5cc22ac3531caff665c992d70e0bd268649218bb
parent6ea933c7e8f6988d5647af4a0eafd393a4c3685a
Add support for __wchar_t in -fms-extensions mode.

MSVC provides __wchar_t. This is the same as the built-in wchar_t type
from C++, but it is also available with -fno-wchar and in C.

The commit changes ASTContext to have two different types for this:

  - WCharTy is the built-in type used for wchar_t in C++ and __wchar_t.

  - WideCharTy is the type of a wide character literal. In C++ this is
    the same as WCharTy, and in C  it is an integer type compatible with
    the type in <stddef.h>.

This fixes PR15815.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181587 91177308-0d34-0410-b5e6-96231b3b80d8
15 files changed:
include/clang/AST/ASTContext.h
include/clang/AST/PrettyPrinter.h
include/clang/Basic/TokenKinds.def
lib/AST/ASTContext.cpp
lib/AST/Type.cpp
lib/Analysis/FormatString.cpp
lib/Analysis/PrintfFormatString.cpp
lib/Analysis/ScanfFormatString.cpp
lib/Sema/SemaDeclCXX.cpp
lib/Sema/SemaExpr.cpp
lib/Sema/SemaExprObjC.cpp
lib/Sema/SemaInit.cpp
lib/Sema/SemaTemplateInstantiate.cpp
test/Sema/ms-wchar.c [new file with mode: 0644]
test/SemaCXX/ms-wchar.cpp [new file with mode: 0644]