1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 template<template<typename T
> class MetaFun
, typename Value
>
4 typedef typename MetaFun
<Value
>::type type
;
13 struct add_reference
{
18 apply
<add_pointer
, int>::type ip
= &i
;
19 apply
<add_reference
, int>::type ir
= i
;
20 apply
<add_reference
, float>::type fr
= i
; // expected-error{{non-const lvalue reference to type 'float' cannot bind to a value of unrelated type 'int'}}
22 // Template template parameters
23 template<int> struct B
; // expected-note{{has a different type 'int'}}
26 template<T Value
> class X
> // expected-error{{cannot have type 'float'}} \
27 // expected-note{{with type 'long'}}
31 X0
<float, B
> x0b2
; // expected-note{{while substituting}}
32 X0
<long, B
> x0b3
; // expected-error{{template template argument has different template parameters}}
34 template<template<int V
> class TT
> // expected-note{{parameter with type 'int'}}
37 template<typename T
, template<T V
> class TT
>
39 X1
<TT
> x1
; // expected-error{{has different template parameters}}
42 template<int V
> struct X3i
{ };
43 template<long V
> struct X3l
{ }; // expected-note{{different type 'long'}}
46 X2
<long, X3l
> x2bad
; // expected-note{{instantiation}}
48 template <typename T
, template <T
, T
> class TT
, class R
= TT
<1, 2> >
51 template <T x
, T y
> struct gt
{
52 static const bool result
= x
> y
;
57 template <int x
, int y
> struct lt
{
58 static const bool result
= x
< y
;
64 template<template<int> class TT
> struct X0
68 template<int> struct Type
{ };
70 template<class T
> struct X1
72 template<class U
> struct Inner
;
74 template<class U
> void g()
76 typedef Inner
<U
> Init
;
77 X0
<Init::template VeryInner
>::apply();
79 template<int N
> void f ()
84 template<class T
> template<class U
> struct X1
<T
>::Inner
86 template<int> struct VeryInner
{