aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.pt/memtemp78.C
blob: 73348351f0d494c2d280291365ea9f68567ea664 (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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// { dg-do assemble  }

struct A 
{
  void f() {}

  template <class U>
  void f() {}
};


template <class T>
struct B
{
  void f() {}

  template <class U>
  void f() {}
};

template struct B<int>;

struct C 
{
  template <class U>
  void f() {}  // { dg-error "with" } redeclaration

  template <class U>
  void f() {}  // { dg-error "overloaded" } redeclaration
};


template <class T, class U>
struct D
{
  void f(T);
  void f(U);
};

template struct D<int, double>;

template <class T, class U>
struct D2
{
  void f(T); // { dg-error "with" } redeclaration 
  void f(U); // { dg-error "overloaded" } redeclaration 
};

template struct D2<int, int>; 

struct E
{
  void f();  // { dg-error "with" } redeclaration
  void f(); // { dg-error "overloaded" } redeclaration
};