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

Method enum9

test/testsymboldatabase.cpp:6542–6553  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6540 }
6541
6542 void enum9() {
6543 GET_SYMBOL_DB("const int x = 7; enum E { X0 = x, X1 };\n");
6544 ASSERT(db != nullptr);
6545 const Enumerator *X0 = db->scopeList.back().findEnumerator("X0");
6546 ASSERT(X0);
6547 ASSERT(X0->value_known);
6548 ASSERT_EQUALS(X0->value, 7);
6549 const Enumerator *X1 = db->scopeList.back().findEnumerator("X1");
6550 ASSERT(X1);
6551 ASSERT(X1->value_known);
6552 ASSERT_EQUALS(X1->value, 8);
6553 }
6554
6555 void enum10() { // #11001
6556 GET_SYMBOL_DB_C("int b = sizeof(enum etag {X, Y});\n");

Callers

nothing calls this directly

Calls 1

findEnumeratorMethod · 0.80

Tested by

no test coverage detected