summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/other/default5.C
blob: d5bae344c4470ebe07f01cafbc60678deb3b6e08 (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
// PR c++/28274
// { dg-do compile }

void f1(int, int, int, int, int = 0);
void f1(int, int, int, int = 0, int);
void f1(int, int, int = 0, int, int);
void f1(int = 0, int, int, int, int);    // { dg-error "default" }

void f2(int, int, int, int, int = 0) {}
void f2(int, int, int, int = 0, int);
void f2(int, int, int = 0, int, int);
void f2(int = 0, int, int, int, int);    // { dg-error "default" }

void f3(int, int, int, int, int = 0);
void f3(int, int, int, int = 0, int) {}
void f3(int, int, int = 0, int, int);
void f3(int = 0, int, int, int, int);    // { dg-error "default" }

void f4(int, int, int, int, int = 0);
void f4(int, int, int, int = 0, int);
void f4(int, int, int = 0, int, int) {}
void f4(int = 0, int, int, int, int);    // { dg-error "default" }

void f5(int, int, int, int, int = 0);
void f5(int, int, int, int = 0, int);
void f5(int, int, int = 0, int, int);
void f5(int = 0, int, int, int, int) {}  // { dg-error "default" }


struct A
{
  void F1(int, int, int = 0);
  void F2(int, int, int = 0);
};

void A::F1(int, int = 0, int) {}
void A::F2(int = 0, int, int) {}  // { dg-error "default" }


template<int> struct B
{
  void F1(int, int, int = 0);
  void F2(int, int, int = 0);
};

template<int N> void B<N>::F1(int, int = 0, int) {}
template<int N> void B<N>::F2(int = 0, int, int) {}  // { dg-error "default" }