MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / enum3

Method enum3

test/testsymboldatabase.cpp:6296–6311  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6294 }
6295
6296 void enum3() {
6297 GET_SYMBOL_DB("enum ABC { A=11,B,C=A+B };");
6298 ASSERT(db && db->scopeList.back().type == ScopeType::eEnum);
6299
6300 /* There is an enum A with value 11 */
6301 const Enumerator *A = db->scopeList.back().findEnumerator("A");
6302 ASSERT(A && A->value==11 && A->value_known);
6303
6304 /* There is an enum B with value 12 */
6305 const Enumerator *B = db->scopeList.back().findEnumerator("B");
6306 ASSERT(B && B->value==12 && B->value_known);
6307
6308 /* There is an enum C with value 23 */
6309 const Enumerator *C = db->scopeList.back().findEnumerator("C");
6310 ASSERT(C && C->value==23 && C->value_known);
6311 }
6312
6313 void enum4() { // #7493
6314 GET_SYMBOL_DB("enum Offsets { O1, O2, O3=5, O4 };\n"

Callers

nothing calls this directly

Calls 1

findEnumeratorMethod · 0.80

Tested by

no test coverage detected