summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.pt/ttp53.C
blob: b43771c8cfb2b23d79ad93fe0559a016ddcae3fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// { dg-do assemble  }

// Submitted by Erez Louidor Lior <s3824888@techst02.technion.ac.il>

template <typename> class H;
template <typename Target, typename Source>
H<Target> foo(const H<Source>&);

template <typename Type>
class H{

#ifdef OK
public:
#endif
  template<template<class, class> class Caster, typename Source>
  static H<Type> cast(const H<Source>& s);

#ifndef OK
  template <typename Target, typename Source>
  friend H<Target> foo(const H<Source>&);
#endif

};

template <class, class> class caster;

template <typename Target, typename Source>
H<Target> foo(const H<Source>& s){
  return H<Target>::template cast<caster, Source>(s);
}

int main(){
  H<int> i;
  foo<const int>(i);
}