@@ -36,9 +36,38 @@ int x0 = 0; // not present
3636int x0 = 1 ; // present
3737#endif // COMPLIANT
3838
39- #ifdef OBJECTLIKE_MACRO // NON_COMPLIANT
40- int x1 = 0 ; // present
41- #elif OBJECTLIKE_MACRO > \
42- - 1 // COMPLIANT - by technicality of conditional compilation
39+ #ifdef OBJECTLIKE_MACRO // NON_COMPLIANT
40+ int x1 = 0 ; // present
41+ #elif OBJECTLIKE_MACRO > -1 // NON_COMPLIANT[FALSE_NEGATIVE] - known due to
42+ // database not containing elements
4343int x1 = 1 ; // not present
44- #endif // COMPLIANT
44+ #endif // COMPLIANT
45+
46+ // case 1 - first present only
47+ #ifdef MACRO_ENABLED_NON_1 // COMPLIANT
48+ #include < string> // present
49+ #elif MACRO_ENABLED_OTHER // NON_COMPLIANT[FALSE_NEGATIVE]
50+ int x = 1 ; // not present
51+ #endif
52+
53+ // case 2 - second present only
54+ #ifdef MACRO_ENABLED_NON // COMPLIANT
55+ #include < string> // not present
56+ #elif MACRO_ENABLED_OTHER_1 // NON_COMPLIANT
57+ int x = 1 ; // present
58+ #endif
59+
60+ // case 3 - neither present
61+ #ifdef MACRO_ENABLED_NON // COMPLIANT
62+ #include < string> // not present
63+ #elif MACRO_ENABLED_OTHER // NON_COMPLIANT[FALSE_NEGATIVE]
64+ int x = 1 ; // not present
65+ #endif
66+
67+ // case 4 - both look present but the second still not bc the condition is not
68+ // required to be evaluated
69+ #ifdef MACRO_ENABLED_NON_1 // COMPLIANT
70+ #include < string> // present
71+ #elif MACRO_ENABLED_OTHER_1 // NON_COMPLIANT[FALSE_NEGATIVE]
72+ int x = 1 ; // not present
73+ #endif
0 commit comments