diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2011-10-26 07:22:48 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2011-10-26 07:22:48 +0000 |
commit | 68a2dc446fe6d32d5da3557902100ed06b21b12b (patch) | |
tree | 07c784f1b9c81c774fe25201b7c53ee506312f20 /lib/AST/Type.cpp | |
parent | f1f6d85694fcf772f6d602fd9709318b08b96328 (diff) |
Correctly perform integral promotions on wchar_t/char16_t/char32_t in C++. <rdar://problem/10309088>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143019 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Type.cpp')
-rw-r--r-- | lib/AST/Type.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp index 0bac5f4f61..e01346cdb6 100644 --- a/lib/AST/Type.cpp +++ b/lib/AST/Type.cpp @@ -1272,6 +1272,10 @@ bool Type::isPromotableIntegerType() const { case BuiltinType::UChar: case BuiltinType::Short: case BuiltinType::UShort: + case BuiltinType::WChar_S: + case BuiltinType::WChar_U: + case BuiltinType::Char16: + case BuiltinType::Char32: return true; default: return false; @@ -1284,10 +1288,7 @@ bool Type::isPromotableIntegerType() const { || ET->getDecl()->isScoped()) return false; - const BuiltinType *BT - = ET->getDecl()->getPromotionType()->getAs<BuiltinType>(); - return BT->getKind() == BuiltinType::Int - || BT->getKind() == BuiltinType::UInt; + return true; } return false; |