diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-05-21 18:55:48 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-05-21 18:55:48 +0000 |
commit | 36bb03b86ab6f905b336ee9ec11f288291b22b45 (patch) | |
tree | f6b50826bfc12068fdffa6cdd5a080213f8a2837 /test/SemaTemplate/instantiate-expr-4.cpp | |
parent | e898f8a94947c6074d76ff83943b47d5bbdf210d (diff) |
Template instantiation for unary type traits, e.g., __is_pod
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72220 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/instantiate-expr-4.cpp')
-rw-r--r-- | test/SemaTemplate/instantiate-expr-4.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/SemaTemplate/instantiate-expr-4.cpp b/test/SemaTemplate/instantiate-expr-4.cpp index 1511c7aaf8..5c32d8c197 100644 --- a/test/SemaTemplate/instantiate-expr-4.cpp +++ b/test/SemaTemplate/instantiate-expr-4.cpp @@ -139,3 +139,14 @@ struct Abstract { template struct TypeId0<int>; template struct TypeId0<Incomplete>; template struct TypeId0<Abstract>; + +// --------------------------------------------------------------------- +// type traits +// --------------------------------------------------------------------- +template<typename T> +struct is_pod { + static const bool value = __is_pod(T); +}; + +static const int is_pod0[is_pod<X>::value? -1 : 1]; +static const int is_pod1[is_pod<Y>::value? 1 : -1]; |