1 //RUN: %clang_cc1 -fsyntax-only -verify %s
5 int f2(const int, int);
7 int f4(const int&, int);
10 int(*g1
)(int, int) = f1
;
11 int(*g2
)(const int, int) = f1
;
12 int(*g3
)(volatile int, int) = f1
;
13 int(*g4
)(int, int) = f2
;
14 int(*g5
)(const int, int) = f2
;
15 int(*g6
)(volatile int, int) = f2
;
16 int(*g7
)(int&, int) = f3
;
17 int(*g8
)(const int&, int) = f4
;
21 void (*g1
)(int, int) = f1
;
22 // expected-error@-1 {{different return type ('void' vs 'int'}}
23 const int (*g2
)(int, int) = f1
;
24 // expected-error@-1 {{different return type ('const int' vs 'int')}}
26 int (*g3
)(char, int) = f1
;
27 // expected-error@-1 {{type mismatch at 1st parameter ('char' vs 'int')}}
28 int (*g4
)(int, char) = f1
;
29 // expected-error@-1 {{type mismatch at 2nd parameter ('char' vs 'int')}}
32 // expected-error@-1 {{different number of parameters (1 vs 2)}}
34 int (*g6
)(int, int, int) = f1
;
35 // expected-error@-1 {{different number of parameters (3 vs 2)}}
37 int (*g7
)(const int, char) = f1
;
38 // expected-error@-1 {{type mismatch at 2nd parameter ('char' vs 'int')}}
39 int (*g8
)(int, char) = f2
;
40 // expected-error@-1 {{type mismatch at 2nd parameter ('char' vs 'int')}}
41 int (*g9
)(const int&, char) = f3
;
42 // expected-error@-1 {{type mismatch at 1st parameter ('const int &' vs 'int &')}}
43 int (*g10
)(int&, char) = f4
;
44 // expected-error@-1 {{type mismatch at 1st parameter ('int &' vs 'const int &')}}
47 typedef void (*F
)(const char * __restrict__
, int);
48 void g(const char *, unsigned);
50 // expected-error@-1 {{type mismatch at 2nd parameter ('int' vs 'unsigned int')}}