OSDN Git Service

* cp-tree.h (DECL_TEMPLATE_INSTANTIATED): New macro.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.old-deja / g++.pt / ttp53.C
1 // Build don't link:
2
3 // Submitted by Erez Louidor Lior <s3824888@techst02.technion.ac.il>
4
5 template <typename> class H;
6 template <typename Target, typename Source>
7 H<Target> foo(const H<Source>&);
8
9 template <typename Type>
10 class H{
11
12 #ifdef OK
13 public:
14 #endif
15   template<template<class, class> class Caster, typename Source>
16   static H<Type> cast(const H<Source>& s);
17
18 #ifndef OK
19   template <typename Target, typename Source>
20   friend H<Target> foo(const H<Source>&);
21 #endif
22
23 };
24
25 template <class, class> class caster;
26
27 template <typename Target, typename Source>
28 H<Target> foo(const H<Source>& s){
29   return H<Target>::template cast<caster, Source>(s);
30 }
31
32 int main(){
33   H<int> i;
34   foo<const int>(i);
35 }