Ticket #6059: Properly handle class... in parameter lists.

Hi,

This ticket is pretty similar to ticket #5774 and deserves the same kind of fix, which this PR does. Thanks to consider merging.

Cheers,
  Simon