There is a reported bug on the checker not handling the some APSInt values correctly: https://bugs.llvm.org/show_bug.cgi?id=34400
This patch fixes it, however, it shows a false positive. (Added to the test cases)
I am not sure if it's a checker or AST problem. The AST dump shows the following:
-BinaryOperator 0x1195b98 <col:38, col:43> 'int' '|' |-ImplicitCastExpr 0x1195b68 <col:38> 'int' <IntegralCast> | `-DeclRefExpr 0x1195b18 <col:38> 'enum j<struct c<int, 0, 0, 0, 0, 0> >::(anonymous at dude.cpp:15:3)' EnumConstant 0x1193b98 'ah' 'enum a<struct f<struct c<int, 0, 0, 0, 0, 0>, struct c<int, 0, -1, 0, 0, -1>, 0> >::(anonymous at dude.cpp:29:3)' `-ImplicitCastExpr 0x1195b80 <col:43> 'int' <IntegralCast> `-DeclRefExpr 0x1195b40 <col:43> 'enum j<struct c<int, 0, -1, 0, 0, -1> >::(anonymous at dude.cpp:15:3)' EnumConstant 0x1195ad0 'ai' 'enum a<struct f<struct c<int, 0, 0, 0, 0, 0>, struct c<int, 0, -1, 0, 0, -1>, 0> >::(anonymous at dude.cpp:29:3)'
I am not sure if this is right since this belongs to the following code snippet (maybe I am just missing something):
enum { ah = ad::m, ai = ae::m, l = ah | ai };
What do you think?