diff options
Diffstat (limited to 'test/PCH/cxx-templates.h')
-rw-r--r-- | test/PCH/cxx-templates.h | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/test/PCH/cxx-templates.h b/test/PCH/cxx-templates.h index 978d768..d2c820f 100644 --- a/test/PCH/cxx-templates.h +++ b/test/PCH/cxx-templates.h @@ -135,3 +135,61 @@ void S4ImplicitInst() { S4<int> s; s.m(); } + +struct S5 { + S5(int x); +}; + +struct TS5 { + S5 s; + template <typename T> + TS5(T y) : s(y) {} +}; + +// PR 8134 +template<class T> void f_PR8134(T); +template<class T> void f_PR8134(T); +void g_PR8134() { f_PR8134(0); f_PR8134('x'); } + +// rdar8580149 +template <typename T> +struct S6; + +template <typename T, unsigned N> +struct S6<const T [N]> +{ +private: + typedef const T t1[N]; +public: + typedef t1& t2; +}; + +template<typename T> + struct S7; + +template<unsigned N> +struct S7<int[N]> : S6<const int[N]> { }; + +// Zero-length template argument lists +namespace ZeroLengthExplicitTemplateArgs { + template<typename T> void h(); + + struct Y { + template<typename T> void f(); + }; + + template<typename T> + void f(T *ptr) { + T::template g<>(17); + ptr->template g2<>(17); + h<T>(); + h<int>(); + Y y; + y.f<int>(); + } + + struct X { + template<typename T> static void g(T); + template<typename T> void g2(T); + }; +} |