Last change
on this file since 3ac5fd8 was
afb15cf,
checked in by Andrew Beach <ajbeach@…>, 3 months ago
|
Added a check to make sure that optional parameters to not appear on function types not attached to function declarations.
|
-
Property mode set to
100644
|
File size:
414 bytes
|
Rev | Line | |
---|
[afb15cf] | 1 | // Check that function declarations can have optional parameters, but |
---|
| 2 | // function types cannot. |
---|
| 3 | |
---|
| 4 | void 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 | void bad_cases( |
---|
| 12 | int (*fee)( int i = 10 ), |
---|
| 13 | int (*fie)( int = 10 ), |
---|
| 14 | void feo( int (*p)( int = 10 ) ), |
---|
| 15 | void fum( int (*)( int = 10 ) ) |
---|
| 16 | ); |
---|
Note: See
TracBrowser
for help on using the repository browser.