OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.dg/] [template/] [unify10.C] - Blame information for rev 823

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
// { dg-do compile }
2
// Origin: Wolfgang Bangerth 
3
//     and Rene Fonseca 
4
// PR c++/8271: Check cv-qualifiers while unifying pointer to member
5
//  functions.
6
 
7
struct MyClass {
8
  void mMethod() throw() {}
9
  void cMethod() const throw() {}
10
  void vMethod() volatile throw() {}
11
  void cvMethod() const volatile throw() {}
12
};
13
 
14
template
15
void mFunction(void (CLASS::* method)()) {}
16
 
17
template
18
void cFunction(void (CLASS::* method)() const) {}
19
 
20
template
21
void vFunction(void (CLASS::* method)() volatile) {}
22
 
23
template
24
void cvFunction(void (CLASS::* method)() const volatile) {}
25
 
26
int main() {
27
  mFunction(&MyClass::mMethod);
28
  mFunction(&MyClass::cMethod);    // { dg-error "no matching function" }
29
  mFunction(&MyClass::vMethod);    // { dg-error "no matching function" }
30
  mFunction(&MyClass::cvMethod);   // { dg-error "no matching function" }
31
 
32
  cFunction(&MyClass::mMethod);    // { dg-error "no matching function" }
33
  cFunction(&MyClass::cMethod);
34
  cFunction(&MyClass::vMethod);    // { dg-error "no matching function" }
35
  cFunction(&MyClass::cvMethod);   // { dg-error "no matching function" }
36
 
37
  vFunction(&MyClass::mMethod);    // { dg-error "no matching function" }
38
  vFunction(&MyClass::cMethod);    // { dg-error "no matching function" }
39
  vFunction(&MyClass::vMethod);
40
  vFunction(&MyClass::cvMethod);   // { dg-error "no matching function" }
41
 
42
  cvFunction(&MyClass::mMethod);   // { dg-error "no matching function" }
43
  cvFunction(&MyClass::cMethod);   // { dg-error "no matching function" }
44
  cvFunction(&MyClass::vMethod);   // { dg-error "no matching function" }
45
  cvFunction(&MyClass::cvMethod);
46
 
47
  return 0;
48
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.