aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/memtemp11.C
blob: 8e8c3c1acdd92c819b74937ca19d9a5af67f0296 (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
// { dg-do link  }
// GROUPS passed templates membertemplates
extern "C" int printf(const char*, ...);

struct S
{
  template <class U>
  S(U u, int i) {}

  template <class T>
  T foo(T t) 
  { 
    printf("Hello, world.\n");
    return t; 
  }
};


int main()
{
  S s(3, 4);
  int i = s.foo(3);
  s.foo("hello");
  s.foo(s);
  
  S s2("hello", 5);
}