summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/other/cv_func.C
blob: 941cb8d53d86cf07b894d2fb6f421e765cd27e03 (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
// { dg-do compile }

typedef int FIC(int) const;
typedef int FI(int);

FIC f; // { dg-error "qualified" }
struct S {
  FIC f; // OK

  const FI g;

  int h(int) const;

};
FIC S::*pm = &S::f;
const FI S::*pm2 = &S::f; // { dg-error "cannot convert" }
const FIC S::*pm3 = &S::f;

int S::f(int) const
{
  return 17;
}


int foo(float) const // { dg-error "qualifier" }
{
  return 0;
}

int bar(float) volatile; // { dg-error "qualifier" }