aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/DeclSpec.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-04-04 06:24:32 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-04-04 06:24:32 +0000
commit5a5a971908a1fd064454db44c42333a3aecf3d5b (patch)
treebf93fa42041b74e37c2391986f3996ce9ced91f5 /lib/Sema/DeclSpec.cpp
parentd280389b42bb55cd8969eae181dc3ff9f05e9aaf (diff)
For PR11916: Add support for g++'s __int128 keyword. Unlike __int128_t, this is
a type specifier and can be combined with unsigned. This allows libstdc++4.7 to be used with clang in c++98 mode. Several other changes are still required for libstdc++4.7 to work with clang in c++11 mode. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153999 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/DeclSpec.cpp')
-rw-r--r--lib/Sema/DeclSpec.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Sema/DeclSpec.cpp b/lib/Sema/DeclSpec.cpp
index 97e00f0c56..b531accf86 100644
--- a/lib/Sema/DeclSpec.cpp
+++ b/lib/Sema/DeclSpec.cpp
@@ -264,6 +264,7 @@ bool Declarator::isDeclarationOfFunction() const {
case TST_float:
case TST_half:
case TST_int:
+ case TST_int128:
case TST_struct:
case TST_union:
case TST_unknown_anytype:
@@ -379,6 +380,7 @@ const char *DeclSpec::getSpecifierName(DeclSpec::TST T) {
case DeclSpec::TST_char16: return "char16_t";
case DeclSpec::TST_char32: return "char32_t";
case DeclSpec::TST_int: return "int";
+ case DeclSpec::TST_int128: return "__int128";
case DeclSpec::TST_half: return "half";
case DeclSpec::TST_float: return "float";
case DeclSpec::TST_double: return "double";
@@ -818,7 +820,7 @@ void DeclSpec::Finish(DiagnosticsEngine &D, Preprocessor &PP) {
if (TypeSpecSign != TSS_unspecified) {
if (TypeSpecType == TST_unspecified)
TypeSpecType = TST_int; // unsigned -> unsigned int, signed -> signed int.
- else if (TypeSpecType != TST_int &&
+ else if (TypeSpecType != TST_int && TypeSpecType != TST_int128 &&
TypeSpecType != TST_char && TypeSpecType != TST_wchar) {
Diag(D, TSSLoc, diag::err_invalid_sign_spec)
<< getSpecifierName((TST)TypeSpecType);