1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 // expected-no-diagnostics
4 // Core issue 150: Template template parameters and default arguments
6 template<typename T
, typename U
>
8 static const bool value
= false;
12 struct is_same
<T
, T
> {
13 static const bool value
= true;
17 template<class _T
, class Traits
> class IM
;
19 template <class T
, class Trt
,
20 template<class _T
, class Traits
= int> class IntervalMap
>
21 void foo(IntervalMap
<T
,Trt
>* m
) { typedef IntervalMap
<int> type
; }
23 void f(IM
<int, int>* m
) { foo(m
); }
27 template<template <typename T
, typename
= T
> class U
> struct A
29 template<int> U
<int> foo();
32 template <typename T
, typename
= T
>
42 namespace MultiReplace
{
44 template<typename T
, typename U
= T
*, typename V
= U
const> class TT
>
49 template<typename T
, typename
= int, typename
= float>
52 int check0
[is_same
<X
<int, Y
>::type
, Y
<int, int*, int* const> >::value
? 1 : -1];
55 namespace MultiReplacePartial
{
56 template<typename First
, typename Z
,
57 template<typename T
, typename U
= T
*, typename V
= U
const> class TT
>
63 template<typename T
, typename U
= T
*, typename V
= U
const> class TT
>
64 struct X
<int, Z
, TT
> {
68 template<typename T
, typename
= int, typename
= float>
71 int check0
[is_same
<X
<int, int, Y
>::type
, Y
<int, int*, int* const> >::value
? 1 : -1];
75 template<typename
> struct allocator
;
76 template<typename
> struct less
;
78 template<class T
, template<class> class Compare
, class Default
,
79 template<class> class Alloc
>
80 struct interval_set
{ };
82 template <class X
, template<class> class = less
> struct interval_type_default
{
87 template<class _T
, template<class> class Compare
= PR9016::less
,
88 class = typename interval_type_default
<_T
,Compare
>::type
,
89 template<class> class = allocator
> class IntervalSet
>
92 IntervalSet
<T
> IntervalSetT
;
96 template<class _T
, template<class> class Compare
= PR9016::less
,
97 class = typename interval_type_default
<_T
,Compare
>::type
,
98 template<class> class = allocator
> class IntervalSet
>
101 IntervalSet
<T
> IntervalSetT
;
105 ZZZ
<int, interval_set
> zzz
;
106 int40
<int, interval_set
>();