[cfe-dev] Getting number of possible values for an enum

Mads Ravn via cfe-dev cfe-dev at lists.llvm.org
Tue Aug 13 02:12:48 PDT 2019


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20190813/507ce115/attachment.html>


More information about the cfe-dev mailing list