diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2012-01-10 04:58:17 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2012-01-10 04:58:17 +0000 |
commit | 7ead5c7b6fd48cf549e55b4db499c26ecf88ae75 (patch) | |
tree | eeafa766caa81cbf5da3282bf0ca565d5a5b260f /lib/AST/Type.cpp | |
parent | 610a60c0e68e34db5a5247d6102e58f37510fef8 (diff) |
Implement the missing pieces of Evaluate for _Complex types. With that complete, remove some code from CGExprConstant which is no longer necessary. While I'm here, a couple minor tweaks to _Complex-in-C++. (Specifically, make _Complex types literal types, and don't warn for _Complex int.)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147840 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Type.cpp')
-rw-r--r-- | lib/AST/Type.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp index 3c4845d85a..4584ca09d9 100644 --- a/lib/AST/Type.cpp +++ b/lib/AST/Type.cpp @@ -1148,8 +1148,10 @@ bool Type::isLiteralType() const { // C++0x [basic.types]p10: // A type is a literal type if it is: // -- a scalar type; or - // As an extension, Clang treats vector types as literal types. - if (BaseTy->isScalarType() || BaseTy->isVectorType()) + // As an extension, Clang treats vector types and complex types as + // literal types. + if (BaseTy->isScalarType() || BaseTy->isVectorType() || + BaseTy->isAnyComplexType()) return true; // -- a reference type; or if (BaseTy->isReferenceType()) |