Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 815fb834 authored by Yabin Cui's avatar Yabin Cui Committed by Android (Google) Code Review
Browse files

Merge "Fix enum_value_name() for compiler update." into sc-dev-plus-aosp

parents 4cab2a6c ecb965cd
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -50,6 +50,10 @@ constexpr std::optional<std::string_view> enum_value_name() {

    // Example (cont'd): V = android::test::TestEnums::ONE
    view = view.substr(valStart);
    // Check invalid enum values with cast, like V = (android::test::TestEnums)8.
    if (view.find('(') != std::string::npos) {
        return std::nullopt;
    }
    size_t nameStart = view.rfind("::");
    if (nameStart == std::string::npos) {
        return std::nullopt;