Getting number of possible values for an enum

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Getting number of possible values for an enum

Nathan Ridge via cfe-dev
Hi,

I am trying to fix a bug in a clang-tidy check. This is the bug: https://bugs.llvm.org/show_bug.cgi?id=42929 . The problem is that when this code tries to find the amount of possible enum values it just asks `Context.getTypeSize(T)` on QualType T. In this case the enum is treated as 32-bit integer and will return the wrong result.

I would like to know how a find the maximum amount of possible values for an enum. Can anyone help me out?

Best regards,
Mads Ravn

_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev