Fixed #11807 - dump: C typedef enum not in <typedef-info>
- Enum typedefs were removed from simplifyTypedefCpp "tok" list instead of unions.
As mentioned by Daniel here, the latest cppcheck version seems to not be affected by the issue anymore. But this is the fix nonetheless.
It was tested on the newest version (no effect) and an older version (commit 579938a6ff on main).
Ok so apparently this makes an enum test fail. I don't really understand what's the test purpose nor what it's testing.
With your fix applied, we produce invalid code like namespace N { enum E { } ; } void g ( int ) ; void f ( ) { g ( sizeof ( enum enum E ) ) ; } for certain inputs.
You said that the original problem is already fixed anyway? It would be nice to add a test for that, so regressions can be avoided in the future.
With your fix applied, we produce invalid code like
namespace N { enum E { } ; } void g ( int ) ; void f ( ) { g ( sizeof ( enum enum E ) ) ; }for certain inputs. You said that the original problem is already fixed anyway? It would be nice to add a test for that, so regressions can be avoided in the future.
Yes, that makes sense actually. Since the new version adds the enum typedef in some other way that I'm not familiar with, it is very possible enum typedefs are now added twice with this fix.
I'll look into how the tests work.