diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-06-04 00:21:18 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-06-04 00:21:18 +0000 |
commit | d560d5025a0e5b1942d99d5f39005337b03a64c2 (patch) | |
tree | 833dd9cbf4b36f3ecbdcd3aa2b92fb12d59e0765 /test/SemaTemplate/temp_class_spec.cpp | |
parent | 33412927aea33539b4e92df381e2fb071d4d9bb9 (diff) | |
download | clang-d560d5025a0e5b1942d99d5f39005337b03a64c2.tar.gz |
Template argument deduction for references
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72822 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/temp_class_spec.cpp')
-rw-r--r-- | test/SemaTemplate/temp_class_spec.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/SemaTemplate/temp_class_spec.cpp b/test/SemaTemplate/temp_class_spec.cpp index 1efb364a1b..710fa4ada5 100644 --- a/test/SemaTemplate/temp_class_spec.cpp +++ b/test/SemaTemplate/temp_class_spec.cpp @@ -19,6 +19,19 @@ int array1[is_pointer<int*>::value? 1 : -1]; int array2[is_pointer<const int*>::value? 1 : -1]; // expected-error{{partial ordering}} \ // expected-error{{negative}} +template<typename T> +struct is_lvalue_reference { + static const bool value = false; +}; + +template<typename T> +struct is_lvalue_reference<T&> { + static const bool value = true; +}; + +int lvalue_ref0[is_lvalue_reference<int>::value? -1 : 1]; +int lvalue_ref1[is_lvalue_reference<const int&>::value? 1 : -1]; + template<typename T, typename U> struct is_same { static const bool value = false; |