Ticket #5816: Properly handle template'd template parameters in enum initializers

Hi,

I turns out that I reduced the test case in this ticket#5816  too much in https://github.com/danmar/cppcheck/pull/310, and I fixed some issues but not the reported case... (thanks to amai for finding out!).

This patch fully fixes the ticket by properly handling template types in template'd enum initializers. Please consider merging.

Cheers,
  Simon