mirror of
https://github.com/google/flatbuffers.git
synced 2026-07-02 00:03:57 +00:00
Correctly generate identifier for enums. (#4871)
This should allow the EnumName* function to work with enums generated using the --scoped-enum flag.
This commit is contained in:
committed by
Wouter van Oortmerssen
parent
e203882d54
commit
75601b81cc
@@ -991,7 +991,7 @@ class CppGenerator : public BaseGenerator {
|
|||||||
for (auto it = enum_def.vals.vec.begin(); it != enum_def.vals.vec.end();
|
for (auto it = enum_def.vals.vec.begin(); it != enum_def.vals.vec.end();
|
||||||
++it) {
|
++it) {
|
||||||
const auto &ev = **it;
|
const auto &ev = **it;
|
||||||
code_ += " case {{ENUM_NAME}}_" + Name(ev) + ": return \"" +
|
code_ += " case " + GetEnumValUse(enum_def, ev) + ": return \"" +
|
||||||
Name(ev) + "\";";
|
Name(ev) + "\";";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user