diff options
| author | Sebastian Redl <sebastian.redl@getdesigned.at> | 2009-01-05 20:52:13 +0000 |
|---|---|---|
| committer | Sebastian Redl <sebastian.redl@getdesigned.at> | 2009-01-05 20:52:13 +0000 |
| commit | baad4e765f5a03af2cbd5fbccffb8736badd517a (patch) | |
| tree | 5bb23acba40adec7aa431f00cdc2713267481a00 /clang/lib/AST/ExprConstant.cpp | |
| parent | 52e5deece5b99ff5d2ca5547c4c894397da1be41 (diff) | |
| download | bcm5719-llvm-baad4e765f5a03af2cbd5fbccffb8736badd517a.tar.gz bcm5719-llvm-baad4e765f5a03af2cbd5fbccffb8736badd517a.zip | |
PODness and Type Traits
Make C++ classes track the POD property (C++ [class]p4)
Track the existence of a copy assignment operator.
Implicitly declare the copy assignment operator if none is provided.
Implement most of the parsing job for the G++ type traits extension.
Fully implement the low-hanging fruit of the type traits:
__is_pod: Whether a type is a POD.
__is_class: Whether a type is a (non-union) class.
__is_union: Whether a type is a union.
__is_enum: Whether a type is an enum.
__is_polymorphic: Whether a type is polymorphic (C++ [class.virtual]p1).
llvm-svn: 61746
Diffstat (limited to 'clang/lib/AST/ExprConstant.cpp')
| -rw-r--r-- | clang/lib/AST/ExprConstant.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp index db9536633be..de6a14b87b6 100644 --- a/clang/lib/AST/ExprConstant.cpp +++ b/clang/lib/AST/ExprConstant.cpp @@ -428,6 +428,12 @@ public: return true; } + bool VisitUnaryTypeTraitExpr(const UnaryTypeTraitExpr *E) { + Result.zextOrTrunc(getIntTypeSizeInBits(E->getType())); + Result = E->Evaluate(); + return true; + } + private: bool HandleCast(CastExpr* E); }; |

