diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2008-08-09 16:51:54 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2008-08-09 16:51:54 +0000 |
commit | 64c438a4be2a871fa43c78264663ba1e9788b94d (patch) | |
tree | d88760d32970f7715de5fc0d8aa444fa8857628f /lib/Parse/DeclSpec.cpp | |
parent | 907747b3a67a41420ead8ef1fc5e6bd9dc9e0ad9 (diff) |
Implement support for the 'wchar_t' C++ type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54585 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/DeclSpec.cpp')
-rw-r--r-- | lib/Parse/DeclSpec.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Parse/DeclSpec.cpp b/lib/Parse/DeclSpec.cpp index 8e6dacb761..d97dcfac80 100644 --- a/lib/Parse/DeclSpec.cpp +++ b/lib/Parse/DeclSpec.cpp @@ -87,6 +87,7 @@ const char *DeclSpec::getSpecifierName(DeclSpec::TST T) { case DeclSpec::TST_unspecified: return "unspecified"; case DeclSpec::TST_void: return "void"; case DeclSpec::TST_char: return "char"; + case DeclSpec::TST_wchar: return "wchar_t"; case DeclSpec::TST_int: return "int"; case DeclSpec::TST_float: return "float"; case DeclSpec::TST_double: return "double"; @@ -214,11 +215,12 @@ void DeclSpec::Finish(Diagnostic &D, SourceManager& SrcMgr, const LangOptions &Lang) { // Check the type specifier components first. - // signed/unsigned are only valid with int/char. + // signed/unsigned are only valid with int/char/wchar_t. if (TypeSpecSign != TSS_unspecified) { if (TypeSpecType == TST_unspecified) TypeSpecType = TST_int; // unsigned -> unsigned int, signed -> signed int. - else if (TypeSpecType != TST_int && TypeSpecType != TST_char) { + else if (TypeSpecType != TST_int && + TypeSpecType != TST_char && TypeSpecType != TST_wchar) { Diag(D, TSSLoc, SrcMgr, diag::err_invalid_sign_spec, getSpecifierName( (TST)TypeSpecType)); // signed double -> double. |