diff options
Diffstat (limited to 'test/SemaTemplate/dependent-type-identity.cpp')
-rw-r--r-- | test/SemaTemplate/dependent-type-identity.cpp | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/test/SemaTemplate/dependent-type-identity.cpp b/test/SemaTemplate/dependent-type-identity.cpp index a796834..5b9da5d 100644 --- a/test/SemaTemplate/dependent-type-identity.cpp +++ b/test/SemaTemplate/dependent-type-identity.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s // This test concerns the identity of dependent types within the // canonical type system. This corresponds to C++ [temp.type], which @@ -122,3 +122,24 @@ namespace PR18275 { template struct A<int>; template struct A<int[1]>; } + +namespace PR21289 { + template<typename T> using X = int; + template<typename T, decltype(sizeof(0))> using Y = int; + template<typename ...Ts> struct S {}; + template<typename ...Ts> void f() { + // This is a dependent type. It is *not* S<int>, even though it canonically + // contains no template parameters. + using Type = S<X<Ts>...>; + Type s; + using Type = S<int, int, int>; + } + void g() { f<void, void, void>(); } + + template<typename ...Ts> void h(S<int>) {} + // Pending a core issue, it's not clear if these are redeclarations, but they + // are probably intended to be... even though substitution can succeed for one + // of them but fail for the other! + template<typename ...Ts> void h(S<X<Ts>...>) {} // expected-note {{previous}} + template<typename ...Ts> void h(S<Y<Ts, sizeof(Ts)>...>) {} // expected-error {{redefinition}} +} |