Ticket #5121: Handle static variable declarations depending on one another

Hi,

This simple patch fixes ticket #5121 by properly simplifying comma separated static variable declarations that depend on one another. Thanks to consider merging.

Best regards,
  Simon