From d784e6893cfbdd24b4f701e486adbab9906d4b27 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Wed, 23 Sep 2015 21:41:42 +0000 Subject: 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 --- clang/test/SemaTemplate/alias-templates.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'clang/test/SemaTemplate/alias-templates.cpp') 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 using derived2 = ::PR16904::base::template derived; // expected-error {{expected a type}} expected-error {{expected ';'}} } + +namespace PR14858 { + template using X = int[sizeof...(T)]; + + template struct Y { + using Z = X; + }; + using A = Y::Z; + using A = int[4]; + + // FIXME: These should be treated as being redeclarations. + template void f(X &) {} + template void f(int(&)[sizeof...(T)]) {} + + template void g(X &) {} + template void g(int(&)[sizeof...(T)]) {} // ok, different + + template void h(X &) {} + template void h(X &) {} // ok, different +} -- cgit v1.2.3