aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/abi/mangle79.C
blob: 99ae822201e9531e4331b7d19a1ed7422515f62e (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
57
58
59
60
61
// { dg-do compile { target c++11 } }
// { dg-options "" }

struct S {
  static void foo (S);
  void foo (this S);		// { dg-warning "explicit object member function only available with" "" { target c++20_down } }
  template <int N, typename T>
  static void bar (S, T);
  template <int N, typename T>
  void bar (this S, T);		// { dg-warning "explicit object member function only available with" "" { target c++20_down } }
  static void baz (const S &);
  void baz (this const S &);	// { dg-warning "explicit object member function only available with" "" { target c++20_down } }
};

void
S::foo (S)
{
}

void
S::foo (this S)			// { dg-warning "explicit object member function only available with" "" { target c++20_down } }
{
}

template <int N, typename T>
void
S::bar (S, T)
{
}

template <int N, typename T>
void
S::bar (this S, T)		// { dg-warning "explicit object member function only available with" "" { target c++20_down } }
{
}

void
S::baz (const S &)
{
}

void
S::baz (this const S &)		// { dg-warning "explicit object member function only available with" "" { target c++20_down } }
{
}

void
qux (S *p)
{
  S::foo (*p);
  p->foo ();
  S::bar <5> (*p, 0);
  p->bar <5> (0);
}

// { dg-final { scan-assembler "_ZN1S3fooES_" } }
// { dg-final { scan-assembler "_ZNH1S3fooES_" } }
// { dg-final { scan-assembler "_ZN1S3barILi5EiEEvS_T0_" } }
// { dg-final { scan-assembler "_ZNH1S3barILi5EiEEvS_T0_" } }
// { dg-final { scan-assembler "_ZN1S3bazERKS_" } }
// { dg-final { scan-assembler "_ZNH1S3bazERKS_" } }