source: tests/opt-params.cfa @ 790f251

Last change on this file since 790f251 was 790f251, checked in by Peter A. Buhr <pabuhr@…>, 13 hours ago

update error message for parameter default-initialization in function-pointer declarations

  • Property mode set to 100644
File size: 494 bytes
Line 
1// Check that function declarations can have optional parameters, but
2// function types cannot.
3
4void good_cases(
5        int start = 0,
6        int = -1
7);
8
9// This is a slightly weird way to do it, but it let's us try all the cases
10// before any of the errors cause compilation to stop.
11
12void bad_cases(
13        int (*f1)( int i = 10, int j = 5 ),
14        int (*f2)( int = 10 ),
15        void f3( int (*p)( int = 10 ) ),
16        void f4( int (*)( int = 10 ) ),
17        void f5( int (*p)( int i = 10 ) ),
18        void f6( int (*)( int i = 10 ) )
19);
20
Note: See TracBrowser for help on using the repository browser.