diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-11-11 16:58:32 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-11-11 16:58:32 +0000 |
commit | 9106ef78f8fcc9df1a60c7a5b64c7d967194207e (patch) | |
tree | d1ba885146c514b70147e3a92647fcdf67e8ddc1 /test/SemaTemplate/nested-template.cpp | |
parent | 7bb87fca7d22a8a194d04188746b90f46512975f (diff) |
Instantiation of template template parameters for nested templates, e.g.,
template<typename T>
struct X {
template<template<T Value> class Y> struct Inner;
};
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86844 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/nested-template.cpp')
-rw-r--r-- | test/SemaTemplate/nested-template.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/SemaTemplate/nested-template.cpp b/test/SemaTemplate/nested-template.cpp index 4d948184ce..849d835541 100644 --- a/test/SemaTemplate/nested-template.cpp +++ b/test/SemaTemplate/nested-template.cpp @@ -108,3 +108,21 @@ struct X1 { template<typename, bool = false> struct B { }; }; template struct X1<int>::B<bool>; + +// Template template parameters +template<typename T> +struct X2 { + template<template<class U, T Value> class> // expected-error{{cannot have type 'float'}} \ + // expected-note{{previous non-type template}} + struct Inner { }; +}; + +template<typename T, + int Value> // expected-note{{template non-type parameter}} + struct X2_arg; + +X2<int>::Inner<X2_arg> x2i1; +X2<float>::Inner<X2_arg> x2i2; // expected-note{{instantiation}} +X2<long>::Inner<X2_arg> x2i3; // expected-error{{template template argument has different}} + + |