summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaTemplate/alias-templates.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2015-09-23 21:41:42 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2015-09-23 21:41:42 +0000
commitd784e6893cfbdd24b4f701e486adbab9906d4b27 (patch)
treecb6c302cc41d7d560f657e3ec93c7b0b75a4cb1d /clang/test/SemaTemplate/alias-templates.cpp
parented9b8f0a373b01e93b139f33a85465d79b7154df (diff)
downloadbcm5719-llvm-d784e6893cfbdd24b4f701e486adbab9906d4b27.tar.gz
bcm5719-llvm-d784e6893cfbdd24b4f701e486adbab9906d4b27.zip
PR14858: Initial support for proper sizeof... handling within alias templates.
This doesn't quite get alias template equivalence right yet, but handles the egregious cases where we would silently give the wrong answers. llvm-svn: 248431
Diffstat (limited to 'clang/test/SemaTemplate/alias-templates.cpp')
-rw-r--r--clang/test/SemaTemplate/alias-templates.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/alias-templates.cpp b/clang/test/SemaTemplate/alias-templates.cpp
index e7be184db3d..1849ff64026 100644
--- a/clang/test/SemaTemplate/alias-templates.cpp
+++ b/clang/test/SemaTemplate/alias-templates.cpp
@@ -201,3 +201,23 @@ namespace PR16904 {
template <typename T, typename U, typename V>
using derived2 = ::PR16904::base<T, U>::template derived<V>; // expected-error {{expected a type}} expected-error {{expected ';'}}
}
+
+namespace PR14858 {
+ template<typename ...T> using X = int[sizeof...(T)];
+
+ template<typename ...U> struct Y {
+ using Z = X<U...>;
+ };
+ using A = Y<int, int, int, int>::Z;
+ using A = int[4];
+
+ // FIXME: These should be treated as being redeclarations.
+ template<typename ...T> void f(X<T...> &) {}
+ template<typename ...T> void f(int(&)[sizeof...(T)]) {}
+
+ template<typename ...T> void g(X<typename T::type...> &) {}
+ template<typename ...T> void g(int(&)[sizeof...(T)]) {} // ok, different
+
+ template<typename ...T, typename ...U> void h(X<T...> &) {}
+ template<typename ...T, typename ...U> void h(X<U...> &) {} // ok, different
+}
OpenPOWER on IntegriCloud