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

Method enum17

test/testsymboldatabase.cpp:6804–6822  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6802 }
6803
6804 void enum17() {
6805 {
6806 GET_SYMBOL_DB("struct S {\n" // #12564
6807 " enum class E : std::uint8_t;\n"
6808 " enum class E : std::uint8_t { E0 };\n"
6809 " static void f(S::E e) {\n"
6810 " if (e == S::E::E0) {}\n"
6811 " }\n"
6812 "};\n");
6813 ASSERT(db != nullptr);
6814 auto it = db->scopeList.begin();
6815 std::advance(it, 2);
6816 const Enumerator* E0 = it->findEnumerator("E0");
6817 ASSERT(E0 && E0->value_known && E0->value == 0);
6818 const Token* const e = Token::findsimplematch(tokenizer.tokens(), "E0 )");
6819 ASSERT(e && e->enumerator());
6820 ASSERT_EQUALS(E0, e->enumerator());
6821 }
6822 }
6823
6824 void enum18() {
6825 {

Callers

nothing calls this directly

Calls 3

findsimplematchFunction · 0.85
findEnumeratorMethod · 0.80
beginMethod · 0.45

Tested by

no test coverage detected