aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/other/cv_func.C
blob: 6c9ab1bc2f7db31ada62e1331dfc925ad8d0e625 (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
// { dg-do compile }
// { dg-options "-pedantic -pedantic-errors" }
typedef int FIC(int) const;
typedef int FI(int);

FIC f; // { dg-error "qualified" }
// { dg-error "ignoring" "" { target *-*-* } 6 }
struct S {
  FIC f; // OK

  const FI g; // { dg-error "qualifier" }

  int h(int) const;

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

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


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

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